Attributes
- Companion
- trait
- Graph
-
- Supertypes
- Self type
-
Inferencing.type
Members list
Value members
Concrete methods
Try to fully define tp
. Return whether constraint has changed. Any changed constraint is kept.
Try to fully define tp
. Return whether constraint has changed. Any changed constraint is kept.
Attributes
Replace every top-level occurrence of a wildcard type argument by a fresh skolem type. The skolem types are of the form $i.CAP, where $i is a skolem of type scala.internal.TypeBox
, and CAP
is its type member. See the documentation of TypeBox
for a rationale why we do this.
Replace every top-level occurrence of a wildcard type argument by a fresh skolem type. The skolem types are of the form $i.CAP, where $i is a skolem of type scala.internal.TypeBox
, and CAP
is its type member. See the documentation of TypeBox
for a rationale why we do this.
Attributes
Following type aliases and stripping refinements and annotations, if one arrives at a class type reference where the class has a companion module, a reference to that companion module. Otherwise NoType
Following type aliases and stripping refinements and annotations, if one arrives at a class type reference where the class has a companion module, a reference to that companion module. Otherwise NoType
Attributes
If tp
is top-level type variable with a lower bound in the current constraint, instantiate it from below. We also look for TypeVars in other places where their instantiation could uncover new type members. However that search is best effort only. It might miss type variables that appear in structures involving alias types and type projections.
If tp
is top-level type variable with a lower bound in the current constraint, instantiate it from below. We also look for TypeVars in other places where their instantiation could uncover new type members. However that search is best effort only. It might miss type variables that appear in structures involving alias types and type projections.
Value parameters
- applied
-
Test is done in a
tryInsertImplicitOnQualifier
application. In this case, we always try to instantiate TypeVars in type arguments. Ifapplied
is false, we only try that in arguments that may affect the result type.
Attributes
The fully defined type, where all type variables are forced. Throws an error if type contains wildcards.
The fully defined type, where all type variables are forced. Throws an error if type contains wildcards.
Attributes
If tree
has a type lambda type, infer its type parameters by comparing with expected type pt
If tree
has a type lambda type, infer its type parameters by comparing with expected type pt
Attributes
Instantiate any type variables in tp
whose bounds contain a reference to one of the parameters in paramss
.
Instantiate any type variables in tp
whose bounds contain a reference to one of the parameters in paramss
.
Attributes
Instantiate selected type variables tvars
in type tp
in a special mode:
Instantiate selected type variables tvars
in type tp
in a special mode:
- If a type variable is constrained from below (i.e. constraint bound != given lower bound) it is minimized.
- Otherwise, if the type variable is constrained from above, it is maximized.
- Otherwise, if the type variable has a lower bound != Nothing, it is minimized.
- Otherwise, if the type variable has an upper bound != Any, it is maximized. If none of (1) - (4) applies, the type variable is left uninstantiated. The method is called to instantiate type variables before an implicit search.
Attributes
Is type fully defined, meaning the type does not contain wildcard types or uninstantiated type variables. As a side effect, this will minimize any uninstantiated type variables, according to the given force degree, but only if the overall result of isFullyDefined
is true
. Variables that are successfully minimized do not count as uninstantiated.
Is type fully defined, meaning the type does not contain wildcard types or uninstantiated type variables. As a side effect, this will minimize any uninstantiated type variables, according to the given force degree, but only if the overall result of isFullyDefined
is true
. Variables that are successfully minimized do not count as uninstantiated.
Attributes
Instantiate undetermined type variables so that type tp
is maximized.
Instantiate undetermined type variables so that type tp
is maximized.
Attributes
- Returns
-
The list of type symbols that were created to instantiate undetermined type variables that occur non-variantly
For all type parameters occurring in tp
: If the bounds of tp
in the current constraint are equal wrt =:=, instantiate the type parameter to the lower bound's approximation (approximation because of possible F-bounds).
For all type parameters occurring in tp
: If the bounds of tp
in the current constraint are equal wrt =:=, instantiate the type parameter to the lower bound's approximation (approximation because of possible F-bounds).
Attributes
The list of uninstantiated type variables bound by some prefix of type T
or by arguments of an application prefix, which occur at least once as a formal type parameter of an application either from a prefix or an argument of an application node. Considered prefixes are:
The list of uninstantiated type variables bound by some prefix of type T
or by arguments of an application prefix, which occur at least once as a formal type parameter of an application either from a prefix or an argument of an application node. Considered prefixes are:
- The function
f
of an application nodef(e1, .., en)
- The function
f
of a type application nodef[T1, ..., Tn]
- The prefix
p
of a selectionp.f
. - The result expression
e
of a block{s1; .. sn; e}
.
Attributes
All occurrences of type vars in tp
that satisfy predicate include
mapped to their variances (-1/0/1) in both tp
and pt.finalResultType
, where -1 means: only contravariant occurrences +1 means: only covariant occurrences 0 means: mixed or non-variant occurrences
All occurrences of type vars in tp
that satisfy predicate include
mapped to their variances (-1/0/1) in both tp
and pt.finalResultType
, where -1 means: only contravariant occurrences +1 means: only covariant occurrences 0 means: mixed or non-variant occurrences
We need to take the occurrences in pt
into account because a type variable created when typing the current tree might only appear in the bounds of a type variable in the expected type, for example when ConstraintHandling#legalBound
creates type variables when approximating a bound.
Note: We intentionally use a relaxed version of variance here, where the variance does not change under a prefix of a named type (the strict version makes prefixes invariant). This turns out to be better for type inference. In a nutshell, if a type variable occurs like this:
(U? >: x.type) # T
we want to instantiate U to x.type right away. No need to wait further.