TypeAssigner

Companion
object
class Object
trait Matchable
class Any
class Typer
class ReTyper
class Typer
class Checker

Value members

Concrete methods

def accessibleType(tpe: Type, superAccess: Boolean)(using Context): Type

If tpe is a named type, return the type with those alternatives as denotations which are accessible (or NoType, if no alternatives are accessible).

If tpe is a named type, return the type with those alternatives as denotations which are accessible (or NoType, if no alternatives are accessible).

Also performs the following normalizations on the type tpe. (1) if the owner of the denotation is a package object, it is assured that the package object shows up as the prefix. (2) in Java compilation units, Object is replaced by defn.FromJavaObjectType

def arrayToRepeated(tree: Tree)(using Context): Tree
def assignType(tree: Ident, tp: Type)(using Context): Ident

Type assignment method. Each method takes as parameters

Type assignment method. Each method takes as parameters

  • an untpd.Tree to which it assigns a type,
  • typed child trees it needs to access to cpmpute that type,
  • any further information it needs to access to compute that type.
def assignType(tree: Select, tp: Type)(using Context): Select
def assignType(tree: Select, qual: Tree)(using Context): Select
def assignType(tree: New, tpt: Tree)(using Context): New
def assignType(tree: Literal)(using Context): Literal
def assignType(tree: This)(using Context): This
def assignType(tree: Super, qual: Tree, mixinClass: Symbol)(using Context): Super
def assignType(tree: Apply, fn: Tree, args: List[Tree])(using Context): Apply
def assignType(tree: TypeApply, fn: Tree, args: List[Tree])(using Context): TypeApply
def assignType(tree: Typed, tpt: Tree)(using Context): Typed
def assignType(tree: NamedArg, arg: Tree)(using Context): NamedArg
def assignType(tree: Assign)(using Context): Assign
def assignType(tree: Block, stats: List[Tree], expr: Tree)(using Context): Block
def assignType(tree: Inlined, bindings: List[Tree], expansion: Tree)(using Context): Inlined
def assignType(tree: If, thenp: Tree, elsep: Tree)(using Context): If
def assignType(tree: Closure, meth: Tree, target: Tree)(using Context): Closure
def assignType(tree: CaseDef, pat: Tree, body: Tree)(using Context): CaseDef
def assignType(tree: Match, scrutinee: Tree, cases: List[CaseDef])(using Context): Match
def assignType(tree: Labeled)(using Context): Labeled
def assignType(tree: Return)(using Context): Return
def assignType(tree: WhileDo)(using Context): WhileDo
def assignType(tree: Try, expr: Tree, cases: List[CaseDef])(using Context): Try
def assignType(tree: SeqLiteral, elems: List[Tree], elemtpt: Tree)(using Context): SeqLiteral
def assignType(tree: RefinedTypeTree, parent: Tree, refinements: List[Tree], refineCls: ClassSymbol)(using Context): RefinedTypeTree

Assign type of RefinedType. Refinements are typed as if they were members of refinement class refineCls.

Assign type of RefinedType. Refinements are typed as if they were members of refinement class refineCls.

def assignType(tree: AppliedTypeTree, tycon: Tree, args: List[Tree])(using Context): AppliedTypeTree
def assignType(tree: LambdaTypeTree, tparamDefs: List[TypeDef], body: Tree)(using Context): LambdaTypeTree
def assignType(tree: MatchTypeTree, bound: Tree, scrutinee: Tree, cases: List[CaseDef])(using Context): MatchTypeTree
def assignType(tree: ByNameTypeTree, result: Tree)(using Context): ByNameTypeTree
def assignType(tree: TypeBoundsTree, lo: Tree, hi: Tree, alias: Tree)(using Context): TypeBoundsTree
def assignType(tree: Bind, sym: Symbol)(using Context): Bind
def assignType(tree: Alternative, trees: List[Tree])(using Context): Alternative
def assignType(tree: UnApply, proto: Type)(using Context): UnApply
def assignType(tree: ValDef, sym: Symbol)(using Context): ValDef
def assignType(tree: DefDef, sym: Symbol)(using Context): DefDef
def assignType(tree: TypeDef, sym: Symbol)(using Context): TypeDef
def assignType(tree: Import, sym: Symbol)(using Context): Import
def assignType(tree: Export)(using Context): Export
def assignType(tree: Annotated, arg: Tree, annot: Tree)(using Context): Annotated
def assignType(tree: PackageDef, pid: Tree)(using Context): PackageDef
def avoidingType(expr: Tree, bindings: List[Tree])(using Context): Type
def ensureAccessible(tpe: Type, superAccess: Boolean, pos: SrcPos)(using Context): Type

Try to make tpe accessible, emit error if not possible

Try to make tpe accessible, emit error if not possible

def inaccessibleErrorType(tpe: NamedType, superAccess: Boolean, pos: SrcPos)(using Context): Type
def maybeSkolemizePrefix(qualType: Type, name: Name)(using Context): Type

Return a potentially skolemized version of qualTpe to be used as a prefix when selecting name.

Return a potentially skolemized version of qualTpe to be used as a prefix when selecting name.

See also

QualSkolemType, TypeOps#asSeenFrom

def notAMemberErrorType(tree: Select, qual: Tree)(using Context): ErrorType
def qualifyingClass(tree: Tree, qual: Name, packageOK: Boolean)(using Context): Symbol

The qualifying class of a this or super with prefix qual (which might be empty).

The qualifying class of a this or super with prefix qual (which might be empty).

Value Params
packageOk

The qualifier may refer to a package.

final def reallyExists(denot: Denotation)(using Context): Boolean

A denotation exists really if it exists and does not point to a stale symbol.

A denotation exists really if it exists and does not point to a stale symbol.

def safeSubstParam(tp: Type, pref: ParamRef, argType: Type)(using Context): Type

Substitute argument type argType for parameter pref in type tp, skolemizing the argument type if it is not stable and pref occurs in tp.

Substitute argument type argType for parameter pref in type tp, skolemizing the argument type if it is not stable and pref occurs in tp.

def safeSubstParams(tp: Type, params: List[ParamRef], argTypes: List[Type])(using Context): Type

Substitute types of all arguments args for corresponding params in tp. The number of parameters params may exceed the number of arguments. In this case, only the common prefix is substituted.

Substitute types of all arguments args for corresponding params in tp. The number of parameters params may exceed the number of arguments. In this case, only the common prefix is substituted.

def selectionType(tree: RefTree, qual1: Tree)(using Context): Type

The type of the selection tree, where qual1 is the typed qualifier part.

The type of the selection tree, where qual1 is the typed qualifier part.

def seqToRepeated(tree: Tree)(using Context): Tree
def typeOfNew(tpt: Tree)(using Context): Type

Normalize type T appearing in a new T by following eta expansions to avoid higher-kinded types.

Normalize type T appearing in a new T by following eta expansions to avoid higher-kinded types.