dotty.tools.dotc.typer

Namer

Related Doc: package typer

class Namer extends AnyRef

This class creates symbols from definitions and imports and gives them lazy types.

Timeline:

During enter, trees are expanded as necessary, populating the expandedTree map. Symbols are created, and the symOfTree map is set up.

Symbol completion causes some trees to be already typechecked and typedTree entries are created to associate the typed trees with the untyped expanded originals.

During typer, original trees are first expanded using expandedTree. For each expanded member definition or import we extract and remove the corresponding symbol from the symOfTree map and complete it. We then consult the typedTree map to see whether a typed tree exists already. If yes, the typed tree is returned as result. Otherwise, we proceed with regular type checking.

The scheme is designed to allow sharing of nodes, as long as each duplicate appears in a different method.

Self Type
Typer
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Namer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Namer()

Type Members

  1. class ClassCompleter extends Typer.Completer

  2. class Completer extends LazyType

    The completer of a symbol defined by a member def or import (except ClassSymbols)

  3. class TypeDefCompleter extends Typer.Completer with TypeParamsCompleter

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val ExpandedTree: Key[ast.untpd.Tree]

  5. val SymOfTree: Key[Symbol]

  6. val TypedAhead: Key[ast.tpd.Tree]

  7. def addEnumConstants(mdef: ast.untpd.DefTree, sym: Symbol)(implicit ctx: Context): Unit

    Add java enum constants

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def completeParams(params: List[ast.untpd.MemberDef])(implicit ctx: Context): Unit

    Enter and typecheck parameter list

  11. def createSymbol(tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

    If this tree is a member def or an import, create a symbol of it and store in symOfTree map.

  12. def defDefSig(ddef: ast.untpd.DefDef, sym: Symbol)(implicit ctx: Context): Type

    The type signature of a DefDef with given symbol

  13. def enclosingClassNamed(name: TypeName, pos: Position)(implicit ctx: Context): Symbol

    The enclosing class with given name; error if none exists

  14. def enterSymbol(sym: Symbol)(implicit ctx: Context): Symbol

    If sym exists, enter it in effective scope.

    If sym exists, enter it in effective scope. Check that package members are not entered twice in the same run.

  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  17. def expand(tree: ast.untpd.Tree)(implicit ctx: Context): Unit

    Expand tree and store in expandedTree

  18. def expanded(tree: ast.untpd.Tree)(implicit ctx: Context): ast.untpd.Tree

    The expanded version of this tree, or tree itself if not expanded

  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. def importContext(sym: Symbol, selectors: List[ast.untpd.Tree])(implicit ctx: Context): FreshContext

    A new context that summarizes an import statement

  23. def inClassContext(selfInfo: DotClass)(implicit ctx: Context): Context

    A new context for the interior of a class

  24. def index(stats: List[ast.untpd.Tree])(implicit ctx: Context): Context

    Create top-level symbols for statements and enter them into symbol table

  25. def index(stat: ast.untpd.Tree)(implicit ctx: Context): Context

    Expand tree and create top-level symbols for statement and enter them into symbol table

  26. def indexExpanded(origStat: ast.untpd.Tree)(implicit ctx: Context): Context

    Create top-level symbols for all statements in the expansion of this statement and enter them into symbol table

  27. def invalidateCompanions(pkg: Symbol, xstats: List[ast.untpd.Tree])(implicit ctx: Context): Unit

    For all class definitions stat in xstats: If the companion class if not also defined in xstats, invalidate it by setting its info to NoType.

  28. def isEnumConstant(vd: ast.untpd.ValDef)(implicit ctx: Context): Boolean

    Determines whether this field holds an enum constant.

    Determines whether this field holds an enum constant. To qualify, the following conditions must be met:

    • The field's class has the ENUM flag set
    • The field's class extends java.lang.Enum
    • The field has the ENUM flag set
    • The field is static
    • The field is stable
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. def moduleValSig(sym: Symbol)(implicit ctx: Context): Type

    The signature of a module valdef.

    The signature of a module valdef. This will compute the corresponding module class TypeRef immediately without going through the defined type of the ValDef. This is necessary to avoid cyclic references involving imports and module val defs.

  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. lazy val nestedTyper: AnyRefMap[Symbol, Typer]

    A map from method symbols to nested typers.

    A map from method symbols to nested typers. Populated when methods are completed. Emptied when they are typechecked. The nested typer contains new versions of the four maps above including this one, so that trees that are shared between different DefDefs can be independently used as indices. It also contains a scope that contains nested parameters.

  33. final def notify(): Unit

    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  35. def recordSym(sym: Symbol, tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

    Record sym as the symbol defined by tree

  36. val scope: MutableScope

    The scope of the typer.

    The scope of the typer. For nested typers this is a place parameters are entered during completion and where they survive until typechecking. A context with this typer also has this scope.

  37. def setDocstring(sym: Symbol, tree: ast.untpd.Tree)(implicit ctx: Context): Unit

  38. def symbolOfTree(tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

    The symbol of the given expanded tree.

  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  40. def toString(): String

    Definition Classes
    AnyRef → Any
  41. def typeDefSig(tdef: ast.untpd.TypeDef, sym: Symbol, tparamSyms: List[TypeSymbol])(implicit ctx: Context): Type

  42. def typedAheadAnnotation(tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

  43. def typedAheadExpr(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

  44. def typedAheadType(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

  45. def valOrDefDefSig(mdef: ast.untpd.ValOrDefDef, sym: Symbol, typeParams: List[Symbol], paramss: List[List[Symbol]], paramFn: (Type) ⇒ Type)(implicit ctx: Context): Type

    The type signature of a ValDef or DefDef

    The type signature of a ValDef or DefDef

    mdef

    The definition

    sym

    Its symbol

    paramFn

    A wrapping function that produces the type of the defined symbol, given its final return type

  46. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped