TypeOps
Type members
Value members
Concrete methods
The type tp
as seen from prefix pre
and owner cls
. See the spec
for what this means.
The type tp
as seen from prefix pre
and owner cls
. See the spec
for what this means.
An upper approximation of the given type tp
that does not refer to any symbol in symsToAvoid
.
We need to approximate with ranges:
An upper approximation of the given type tp
that does not refer to any symbol in symsToAvoid
.
We need to approximate with ranges:
term references to symbols in symsToAvoid
,
term references that have a widened type of which some part refers
to a symbol in symsToAvoid
,
type references to symbols in symsToAvoid
,
this types of classes in symsToAvoid
.
Type variables that would be interpolated to a type that needs to be widened are replaced by the widened interpolation instance.
The list of violations where arguments are not within bounds.
The list of violations where arguments are not within bounds.
- Value Params
- app
The applied type whose arguments are checked, or NoType if arguments are for a TypeApply. This is particularly difficult for F-bounds that also contain wildcard arguments (see below). In fact the current treatment for this sitiuation can so far only be classified as "not obviously wrong", (maybe it still needs to be revised).
- args
The arguments
- boundss
The list of type bounds
- instantiate
A function that maps a bound type and the list of argument types to a resulting type. Needed to handle bounds that refer to other bounds.
An abstraction of a class info, consisting of
An abstraction of a class info, consisting of
- the intersection of its parents,
- refined by all non-private fields, methods, and type members,
- abstracted over all type parameters (into a type lambda)
- where all references to
this
of the class are closed over in a RecType.
If tpe
is of the form p.x
where p
refers to a package
but x
is not owned by a package, expand it to
If tpe
is of the form p.x
where p
refers to a package
but x
is not owned by a package, expand it to
p.package.x
Approximate union type by intersection of its dominators. That is, replace a union type Tn | ... | Tn by the smallest intersection type of base-class instances of T1,...,Tn. Example: Given
Approximate union type by intersection of its dominators. That is, replace a union type Tn | ... | Tn by the smallest intersection type of base-class instances of T1,...,Tn. Example: Given
trait C[+T]
trait D
class A extends C[A] with D
class B extends C[B] with D with E
we approximate A | B
by C[A | B] with D
.
Before we do that, we try to find a common non-class supertype of T1 | ... | Tn
in a "best effort", ad-hoc way by selectively widening types in T1, ..., Tn
and stopping if the resulting union simplifies to a type that is not a disjunction.
Refine child based on parent
Refine child based on parent
In child class definition, we have:
class Child[Ts] extends path.Parent[Us] with Es
object Child extends path.Parent[Us] with Es
val child = new path.Parent[Us] with Es // enum values
Given a parent type parent
and a child symbol child
, we infer the prefix
and type parameters for the child:
prefix.child[Vs] <:< parent
where Vs
are fresh type variables and prefix
is the symbol prefix with all
non-module and non-package ThisType
replaced by fresh type variables.
If the subtyping is true, the instantiated type p.child[Vs]
is
returned. Otherwise, NoType
is returned.