Inferencing

dotty.tools.dotc.typer.Inferencing
See theInferencing companion object
trait Inferencing

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Typer
class ReTyper
class InlineTyper
class Typer
class Checker
class LocalChecker
Show all
Self type

Members list

Value members

Concrete methods

def interpolateTypeVars(tree: Tree, pt: Type, locked: TypeVars)(using Context): tree.type

Interpolate undetermined type variables in the widened type of this tree.

Interpolate undetermined type variables in the widened type of this tree.

Value parameters

locked

the set of type variables of the current typer state that cannot be interpolated at the present time Eligible for interpolation are all type variables owned by the current typerstate that are not in locked and whose nestingLevel is >= ctx.nestingLevel. Type variables occurring co- (respectively, contra-) variantly in the tree type or expected type are minimized (respectively, maximized). Non occurring type variables are minimized if they have a lower bound different from Nothing, maximized otherwise. Type variables appearing non-variantly in the type are left untouched. Note that even type variables that do not appear directly in a type, can occur with some variance in the type, because of the constraints. E.g if X occurs co-variantly in T and we have a constraint Y <: X Then Y also occurs co-variantly in T because it needs to be minimized in order to constrain T the least. See variances for more detail.

pt

the expected result type

tree

the tree whose type is interpolated

Attributes