Rechecker

dotty.tools.dotc.transform.Recheck.Rechecker
class Rechecker(ictx: Context)

The typechecker pass

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def checkConforms(tpe: Type, pt: Type, tree: Tree)(using Context): Type

Check that widened types of tpe and pt are compatible.

Check that widened types of tpe and pt are compatible.

Attributes

def checkConformsExpr(actual: Type, expected: Type, tree: Tree, addenda: Addenda)(using Context): Type
def checkUnit(unit: CompilationUnit)(using Context): Unit
def isCompatible(actual: Type, expected: Type)(using Context): Boolean
def keepType(tree: Tree): Boolean

Should type of tree be kept in an attachment so that it can be retrieved with knownType? By default true only is keepAllTypes hold, but can be overridden.

Should type of tree be kept in an attachment so that it can be retrieved with knownType? By default true only is keepAllTypes hold, but can be overridden.

Attributes

def recheck(tree: Tree, pt: Type)(using Context): Type
def recheckAlternative(tree: Alternative, pt: Type)(using Context): Type
def recheckAnnotated(tree: Annotated)(using Context): Type
def recheckApply(tree: Apply, pt: Type)(using Context): Type
def recheckAssign(tree: Assign)(using Context): Type
def recheckBind(tree: Bind, pt: Type)(using Context): Type
def recheckBlock(tree: Block, pt: Type)(using Context): Type
def recheckCase(tree: CaseDef, selType: Type, pt: Type)(using Context): Type
def recheckClassDef(tree: TypeDef, impl: Template, sym: ClassSymbol)(using Context): Type
def recheckClosure(tree: Closure, pt: Type, forceDependent: Boolean)(using Context): Type
def recheckClosureBlock(mdef: DefDef, expr: Closure, pt: Type)(using Context): Type
def recheckDef(tree: ValOrDefDef, sym: Symbol)(using Context): Type
def recheckDefDef(tree: DefDef, sym: Symbol)(using Context): Type
def recheckFinish(tpe: Type, tree: Tree, pt: Type)(using Context): Type

Finish rechecking a tree node: check rechecked type against expected type and remember rechecked type in a tree attachment if required.

Finish rechecking a tree node: check rechecked type against expected type and remember rechecked type in a tree attachment if required.

Value parameters

pt

the expected type

tpe

the recheched type of tree

tree

the rechecked tree

Attributes

def recheckIdent(tree: Ident, pt: Type)(using Context): Type
def recheckIf(tree: If, pt: Type)(using Context): Type
def recheckInlined(tree: Inlined, pt: Type)(using Context): Type
def recheckLabeled(tree: Labeled, pt: Type)(using Context): Type
def recheckMatch(tree: Match, pt: Type)(using Context): Type
def recheckReturn(tree: Return)(using Context): Type
def recheckSelect(tree: Select, pt: Type)(using Context): Type
def recheckSelection(tree: Select, qualType: Type, name: Name, sharpen: Denotation => Denotation)(using Context): Type
def recheckSelection(tree: Select, qualType: Type, name: Name, pt: Type)(using Context): Type

Keep the symbol of the select but re-infer its type

Keep the symbol of the select but re-infer its type

Attributes

def recheckSeqLiteral(tree: SeqLiteral, pt: Type)(using Context): Type
def recheckStart(tree: Tree, pt: Type)(using Context): Type

Recheck tree without adapting it, returning its new type.

Recheck tree without adapting it, returning its new type.

Value parameters

pt

the expected result type

tree

the original tree

Attributes

def recheckStats(stats: List[Tree])(using Context): Unit
def recheckTry(tree: Try, pt: Type)(using Context): Type
def recheckTypeApply(tree: TypeApply, pt: Type)(using Context): Type
def recheckTypeDef(tree: TypeDef, sym: Symbol)(using Context): Type
def recheckTypeTree(tree: TypeTree)(using Context): Type
def recheckTyped(tree: Typed)(using Context): Type
def recheckValDef(tree: ValDef, sym: Symbol)(using Context): Type
def recheckWhileDo(tree: WhileDo)(using Context): Type
def reset()(using Context): Unit

Reset all references in prevSelDenots to the denotations they had before this phase.

Reset all references in prevSelDenots to the denotations they had before this phase.

Attributes

def widenSkolems(tp: Type)(using Context): Type

Typing and previous transforms sometimes leaves skolem types in prefixes of NamedTypes in expected that do not match the actual Type. -Ycheck does not complain (need to find out why), but a full recheck does. We compensate by de-skolemizing everywhere in expected except when variance is negative.

Typing and previous transforms sometimes leaves skolem types in prefixes of NamedTypes in expected that do not match the actual Type. -Ycheck does not complain (need to find out why), but a full recheck does. We compensate by de-skolemizing everywhere in expected except when variance is negative.

Attributes

Returns

If tp contains SkolemTypes in covariant or invariant positions, the type where these SkolemTypes are mapped to their underlying type. Otherwise, tp itself