trait Infer extends Checkable
This trait contains methods related to type parameter inference.
- Self Type
- Analyzer
- Source
- Infer.scala
- Version
1.0
- Alphabetic
- By Inheritance
- Infer
- Checkable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
trait
InferCheckable extends AnyRef
- Definition Classes
- Checkable
-
abstract
class
Inferencer extends Analyzer.InferencerContextErrors with Analyzer.InferCheckable
The context-dependent inferencer part
- class NoInstance extends Throwable with ControlThrowable
Value Members
-
final
def
falseIfNoInstance(body: ⇒ Boolean): Boolean
- Annotations
- @inline()
-
def
formalTypes(formals: List[Global.Type], numArgs: Int, removeByName: Boolean = true, removeRepeated: Boolean = true): List[Global.Type]
The formal parameter types corresponding to
formals
.The formal parameter types corresponding to
formals
. Ifformals
has a repeated last parameter, a list of (numArgs - numFormals + 1) copies of its type is appended to the other formals. By-name types are replaced with their underlying type.- removeByName
allows keeping ByName parameters. Used in NamesDefaults.
- removeRepeated
allows keeping repeated parameter (if there's one argument). Used in NamesDefaults.
-
def
freshVar(tparam: Global.Symbol): Global.TypeVar
A fresh type variable with given type parameter as origin.
-
def
normalize(tp: Global.Type): Global.Type
Automatically perform the following conversions on expression types: A method type becomes the corresponding function type.
Automatically perform the following conversions on expression types: A method type becomes the corresponding function type. A nullary method type becomes its result type. Implicit parameters are skipped. This method seems to be performance critical.
-
def
propagateKnownTypes(from: Global.Type, to: Global.Symbol): Global.Type
The applied type of class 'to' after inferring anything possible from the knowledge that 'to' must also be of the type given in 'from'.
The applied type of class 'to' after inferring anything possible from the knowledge that 'to' must also be of the type given in 'from'.
- Definition Classes
- Checkable
- def skipImplicit(tp: Global.Type): Global.Type
-
def
solvedTypes(tvars: List[Global.TypeVar], tparams: List[Global.Symbol], variances: List[Variance], upper: Boolean, depth: Depth): List[Global.Type]
Solve constraint collected in types
tvars
.Solve constraint collected in types
tvars
.- tvars
All type variables to be instantiated.
- tparams
The type parameters corresponding to
tvars
- variances
The variances of type parameters; need to reverse solution direction for all contravariant variables.
- upper
When
true
search for max solution else min.
- Exceptions thrown
-
object
instantiate extends Global.TypeMap
Map every TypeVar to its constraint.inst field.
Map every TypeVar to its constraint.inst field. throw a NoInstance exception if a NoType or WildcardType is encountered.
The Scala compiler and reflection APIs.