TypeOps
Members list
Type members
Classlikes
The TypeMap handling the asSeenFrom
The TypeMap handling the asSeenFrom
Attributes
- Supertypes
-
trait IdempotentCaptRefMapclass ApproximatingTypeMapclass TypeMapclass VariantTraversalclass Objecttrait Matchableclass AnyShow all
An approximating map that drops NamedTypes matching toAvoid and wildcard types.
An approximating map that drops NamedTypes matching toAvoid and wildcard types.
Attributes
- Supertypes
-
trait IdempotentCaptRefMapclass AvoidWildcardsMapclass ApproximatingTypeMapclass TypeMapclass VariantTraversalclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class LevelAvoidMap
Attributes
- Supertypes
-
class SimplifyMaptrait IdentityCaptRefMapclass TypeMapclass VariantTraversalclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait IdentityCaptRefMapclass TypeMapclass VariantTraversalclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class SimplifyKeepUnchecked
Attributes
- Supertypes
Types
An argument bounds violation is a triple consisting of
An argument bounds violation is a triple consisting of
- the argument tree
- a string "upper" or "lower" indicating which bound is violated
- the violated bound
Attributes
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.
Attributes
An upper approximation of the given type tp that does not refer to any symbol in symsToAvoid and does not contain any WildcardType. We need to approximate with ranges:
An upper approximation of the given type tp that does not refer to any symbol in symsToAvoid and does not contain any WildcardType. 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,
Type variables that would be interpolated to a type that needs to be widened are replaced by the widened interpolation instance.
TODO: Could we replace some or all usages of this method by LevelAvoidMap instead? It would be good to investigate this in details but when I tried it, avoidance for inlined trees broke because TreeMap does not update ctx.nestingLevel when entering a block so I'm leaving this as Future Workâ˘.
Attributes
The list of violations where arguments are not within bounds.
The list of violations where arguments are not within bounds.
Value parameters
- 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.
Attributes
computes a prefix for child, derived from its common prefix with pre
computes a prefix for child, derived from its common prefix with pre
preis assumed to be the prefix ofparentat a given callsite.childis assumed to be the sealed child ofparent, and reachable according towhyNotGenericSum.
Attributes
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
thisof the class are closed over in a RecType.
Attributes
Approximate union type by intersection of its dominators. That is, replace a union type Tn | ... | Tn by the smallest intersection type of accessible 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 accessible 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.
Attributes
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.
Attributes
Implementation of Types#simplified
Implementation of Types#simplified
Attributes
Apply Type.stripTypeVar recursively.
Apply Type.stripTypeVar recursively.