dotty.tools.dotc.typer

Typer

Related Docs: object Typer | package typer

class Typer extends Namer with TypeAssigner with Applications with Implicits with Dynamic with Checking with Docstrings

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Typer
  2. Docstrings
  3. Checking
  4. Dynamic
  5. Implicits
  6. Applications
  7. Compatibility
  8. TypeAssigner
  9. Namer
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Typer()

Type Members

  1. class ApplicableToTrees extends (Applications.this)#TestApplication[ast.tpd.Tree]

    Subclass of Application for applicability tests with type arguments and value argument trees.

    Subclass of Application for applicability tests with type arguments and value argument trees.

    Definition Classes
    Applications
  2. class ApplicableToTreesDirectly extends (Applications.this)#ApplicableToTrees

    Subclass of Application for applicability tests with type arguments and value argument trees.

    Subclass of Application for applicability tests with type arguments and value argument trees.

    Definition Classes
    Applications
  3. class ApplicableToTypes extends (Applications.this)#TestApplication[Type]

    Subclass of Application for applicability tests with value argument types.

    Subclass of Application for applicability tests with value argument types.

    Definition Classes
    Applications
  4. abstract class Application[Arg] extends AnyRef

    Arg

    the type of arguments, could be tpd.Tree, untpd.Tree, or Type

    Definition Classes
    Applications
  5. class ApplyToTyped extends (Applications.this)#TypedApply[Type]

    Subclass of Application for type checking an Apply node with typed arguments.

    Subclass of Application for type checking an Apply node with typed arguments.

    Definition Classes
    Applications
  6. class ApplyToUntyped extends (Applications.this)#TypedApply[Untyped]

    Subclass of Application for type checking an Apply node with untyped arguments.

    Subclass of Application for type checking an Apply node with untyped arguments.

    Definition Classes
    Applications
  7. class ClassCompleter extends Typer.Completer

    Definition Classes
    Namer
  8. class Completer extends LazyType

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

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

    Definition Classes
    Namer
  9. final class ExplainedImplicitSearch extends Typer.ImplicitSearch

    Definition Classes
    Implicits
  10. class ImplicitSearch extends AnyRef

    An implicit search; parameters as in inferImplicit

    An implicit search; parameters as in inferImplicit

    Definition Classes
    Implicits
  11. abstract class TestApplication[Arg] extends (Applications.this)#Application[Arg]

    Subclass of Application for the cases where we are interested only in a "can/cannot apply" answer, without needing to construct trees or issue error messages.

    Subclass of Application for the cases where we are interested only in a "can/cannot apply" answer, without needing to construct trees or issue error messages.

    Definition Classes
    Applications
  12. class TypeDefCompleter extends Typer.Completer with TypeParamsCompleter

    Definition Classes
    Namer
  13. abstract class TypedApply[T >: Untyped] extends (Applications.this)#Application[Tree[T]]

    Subclass of Application for type checking an Apply node, where types of arguments are either known or unknown.

    Subclass of Application for type checking an Apply node, where types of arguments are either known or unknown.

    Definition Classes
    Applications

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]

    Definition Classes
    Namer
  5. val SymOfTree: Key[Symbol]

    Definition Classes
    Namer
  6. val TypedAhead: Key[ast.tpd.Tree]

    Definition Classes
    Namer
  7. def accessibleSelectionType(tree: ast.untpd.RefTree, qual1: ast.tpd.Tree)(implicit ctx: Context): Type

    The selection type, which is additionally checked for accessibility.

    The selection type, which is additionally checked for accessibility.

    Definition Classes
    TypeAssigner
  8. def adapt(tree: ast.tpd.Tree, pt: Type, original: ast.untpd.Tree = untpd.EmptyTree)(implicit ctx: Context): ast.tpd.Tree

  9. def adaptInterpolated(tree: ast.tpd.Tree, pt: Type, original: ast.untpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Perform the following adaptations of expression, pattern or type tree wrt to given prototype pt: (1) Resolve overloading (2) Apply parameterless functions (3) Apply polymorphic types to fresh instances of their type parameters and store these instances in context.undetparams, unless followed by explicit type application.

    Perform the following adaptations of expression, pattern or type tree wrt to given prototype pt: (1) Resolve overloading (2) Apply parameterless functions (3) Apply polymorphic types to fresh instances of their type parameters and store these instances in context.undetparams, unless followed by explicit type application. (4) Do the following to unapplied methods used as values: (4.1) If the method has only implicit parameters pass implicit arguments (4.2) otherwise, if pt is a function type and method is not a constructor, convert to function by eta-expansion, (4.3) otherwise, if the method is nullary with a result type compatible to pt and it is not a constructor, apply it to () otherwise issue an error (5) Convert constructors in a pattern as follows: (5.1) If constructor refers to a case class factory, set tree's type to the unique instance of its primary constructor that is a subtype of the expected type. (5.2) If constructor refers to an extractor, convert to application of unapply or unapplySeq method.

    (6) Convert all other types to TypeTree nodes. (7) When in TYPEmode but not FUNmode or HKmode, check that types are fully parameterized (7.1) In HKmode, higher-kinded types are allowed, but they must have the expected kind-arity (8) When in both EXPRmode and FUNmode, add apply method calls to values of object type. (9) If there are undetermined type variables and not POLYmode, infer expression instance Then, if tree's type is not a subtype of expected type, try the following adaptations: (10) If the expected type is Byte, Short or Char, and the expression is an integer fitting in the range of that type, convert it to that type. (11) Widen numeric literals to their expected type, if necessary (12) When in mode EXPRmode, convert E to { E; () } if expected type is scala.Unit. (13) When in mode EXPRmode, apply AnnotationChecker conversion if expected type is annotated. (14) When in mode EXPRmode, apply a view If all this fails, error

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

    Add java enum constants

    Add java enum constants

    Definition Classes
    Namer
  11. def argCtx(app: ast.untpd.Tree)(implicit ctx: Context): Context

    If app is a this(...) constructor call, the this-call argument context, otherwise the current context.

    If app is a this(...) constructor call, the this-call argument context, otherwise the current context.

    Definition Classes
    Applications
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def assertExists(tp: Type): Type

    Definition Classes
    TypeAssigner
  14. def assignType(tree: ast.untpd.PackageDef, pid: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  15. def assignType(tree: ast.untpd.Annotated, arg: ast.tpd.Tree, annot: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  16. def assignType(tree: ast.untpd.Import, sym: Symbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  17. def assignType(tree: ast.untpd.TypeDef, sym: Symbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  18. def assignType(tree: ast.untpd.DefDef, sym: Symbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  19. def assignType(tree: ast.untpd.ValDef, sym: Symbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  20. def assignType(tree: ast.untpd.UnApply, proto: Type)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  21. def assignType(tree: ast.untpd.Alternative, trees: List[ast.tpd.Tree])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  22. def assignType(tree: ast.untpd.Bind, sym: Symbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  23. def assignType(tree: ast.untpd.TypeBoundsTree, lo: ast.tpd.Tree, hi: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  24. def assignType(tree: ast.untpd.ByNameTypeTree, result: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  25. def assignType(tree: ast.untpd.PolyTypeTree, tparamDefs: List[ast.tpd.TypeDef], body: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  26. def assignType(tree: ast.untpd.AppliedTypeTree, tycon: ast.tpd.Tree, args: List[ast.tpd.Tree])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  27. def assignType(tree: ast.untpd.OrTypeTree, left: ast.tpd.Tree, right: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  28. def assignType(tree: ast.untpd.AndTypeTree, left: ast.tpd.Tree, right: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  29. def assignType(tree: ast.untpd.SingletonTypeTree, ref: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  30. def assignType(tree: ast.untpd.SeqLiteral, elems: List[ast.tpd.Tree], elemtpt: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  31. def assignType(tree: ast.untpd.Try, expr: ast.tpd.Tree, cases: List[ast.tpd.CaseDef])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  32. def assignType(tree: ast.untpd.Return)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  33. def assignType(tree: ast.untpd.Match, cases: List[ast.tpd.CaseDef])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  34. def assignType(tree: ast.untpd.CaseDef, body: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  35. def assignType(tree: ast.untpd.Closure, meth: ast.tpd.Tree, target: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  36. def assignType(tree: ast.untpd.If, thenp: ast.tpd.Tree, elsep: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  37. def assignType(tree: ast.untpd.Inlined, bindings: List[ast.tpd.Tree], expansion: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  38. def assignType(tree: ast.untpd.Block, stats: List[ast.tpd.Tree], expr: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  39. def assignType(tree: ast.untpd.Assign)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  40. def assignType(tree: ast.untpd.NamedArg, arg: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  41. def assignType(tree: ast.untpd.Typed, tpt: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  42. def assignType(tree: ast.untpd.TypeApply, fn: ast.tpd.Tree, args: List[ast.tpd.Tree])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  43. def assignType(tree: ast.untpd.Apply, fn: ast.tpd.Tree, args: List[ast.tpd.Tree])(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  44. def assignType(tree: ast.untpd.Super, qual: ast.tpd.Tree, inConstrCall: Boolean, mixinClass: Symbol = NoSymbol)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  45. def assignType(tree: ast.untpd.This)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  46. def assignType(tree: ast.untpd.Literal)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  47. def assignType(tree: ast.untpd.New, tpt: ast.tpd.Tree)(implicit ctx: Context): ThisTree[Type]

    Definition Classes
    TypeAssigner
  48. def assignType(tree: ast.untpd.Select, qual: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Select

    Definition Classes
    TypeAssigner
  49. def assignType(tree: ast.untpd.Ident, tp: Type)(implicit ctx: Context): ThisTree[Type]

    Type assignment method.

    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.
    Definition Classes
    TypeAssigner
  50. def avoid(tp: Type, symsToAvoid: ⇒ List[Symbol])(implicit ctx: Context): Type

    An upper approximation of the given type tp that does not refer to any symbol in symsToAvoid.

    An upper approximation of the given type tp that does not refer to any symbol in symsToAvoid. Approximation steps are:

    • follow aliases and upper bounds if the original refers to a forbidden symbol
    • widen termrefs that refer to a forbidden symbol
    • replace ClassInfos of forbidden classes by the intersection of their parents, refined by all non-private fields, methods, and type members.
    • if the prefix of a class refers to a forbidden symbol, first try to replace the prefix, if this is not possible, replace the ClassInfo as above.
    • drop refinements referring to a forbidden symbol.
    Definition Classes
    TypeAssigner
  51. def avoidingType(expr: ast.tpd.Tree, bindings: List[ast.tpd.Tree])(implicit ctx: Context): Type

    Definition Classes
    TypeAssigner
  52. def checkCanEqual(ltp: Type, rtp: Type, pos: Position)(implicit ctx: Context): Unit

    Check that equality tests between types ltp and rtp make sense

    Check that equality tests between types ltp and rtp make sense

    Definition Classes
    Implicits
  53. def checkClassType(tp: Type, pos: Position, traitReq: Boolean, stablePrefixReq: Boolean)(implicit ctx: Context): Type

    Check that tp is a class type.

    Check that tp is a class type. Also, if traitReq is true, check that tp is a trait. Also, if stablePrefixReq is true and phase is not after RefChecks, check that class prefix is stable.

    returns

    tp itself if it is a class or trait ref, ObjectType if not.

    Definition Classes
    Checking
  54. def checkFeasible(tp: Type, pos: Position, where: ⇒ String = "")(implicit ctx: Context): Type

    Check that any top-level type arguments in this type are feasible, i.e.

    Check that any top-level type arguments in this type are feasible, i.e. that their lower bound conforms to their upper bound. If a type argument is infeasible, issue and error and continue with upper bound.

    Definition Classes
    Checking
  55. def checkImplicitParamsNotSingletons(vparamss: List[List[ast.tpd.ValDef]])(implicit ctx: Context): Unit

    Check that a non-implicit parameter making up the first parameter section of an implicit conversion is not a singleton type.

    Check that a non-implicit parameter making up the first parameter section of an implicit conversion is not a singleton type.

    Definition Classes
    Checking
  56. def checkInlineConformant(tree: ast.tpd.Tree, what: ⇒ String)(implicit ctx: Context): Unit

    Check that tree is a pure expression of constant type

    Check that tree is a pure expression of constant type

    Definition Classes
    Checking
  57. def checkNoDoubleDefs(cls: Symbol)(implicit ctx: Context): Unit

    Check that class does not define same symbol twice

    Check that class does not define same symbol twice

    Definition Classes
    Checking
  58. def checkNonCyclic(sym: Symbol, info: TypeBounds, reportErrors: Boolean)(implicit ctx: Context): Type

    Definition Classes
    Checking
  59. def checkNotSingleton(tpt: ast.tpd.Tree, where: String)(implicit ctx: Context): ast.tpd.Tree

    Check that tpt does not refer to a singleton type

    Check that tpt does not refer to a singleton type

    Definition Classes
    Checking
  60. def checkParentCall(call: ast.tpd.Tree, caller: ClassSymbol)(implicit ctx: Context): Unit

    Definition Classes
    Checking
  61. def checkRealizableBounds(tp: Type, pos: Position)(implicit ctx: Context): Unit

    Check that all type members of tp have realizable bounds

    Check that all type members of tp have realizable bounds

    Definition Classes
    Checking
  62. def checkSimpleKinded(tpt: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Check that tpt does not define a higher-kinded type

    Check that tpt does not define a higher-kinded type

    Definition Classes
    Checking
  63. def checkStable(tp: Type, pos: Position)(implicit ctx: Context): Unit

    Check that type tp is stable.

    Check that type tp is stable.

    Definition Classes
    Checking
  64. def checkValue(tree: ast.tpd.Tree, proto: Type)(implicit ctx: Context): tree.type

    Check that Java statics and packages can only be used in selections.

    Check that Java statics and packages can only be used in selections.

    Definition Classes
    Checking
  65. def checkVariance(tree: ast.tpd.Tree)(implicit ctx: Context): Unit

    Overridden in retyper

  66. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. def completeAnnotations(mdef: ast.untpd.MemberDef, sym: Symbol)(implicit ctx: Context): Unit

  68. def completeParams(params: List[ast.untpd.MemberDef])(implicit ctx: Context): Unit

    Enter and typecheck parameter list

    Enter and typecheck parameter list

    Definition Classes
    Namer
  69. def constrainResult(mt: Type, pt: Type)(implicit ctx: Context): Boolean

    Check that the result type of the current method fits the given expected result type.

    Check that the result type of the current method fits the given expected result type.

    Definition Classes
    Compatibility
  70. def convertNewGenericArray(tree: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Rewrite new Array[T](....) if T is an unbounded generic to calls to newGenericArray.

    Rewrite new Array[T](....) if T is an unbounded generic to calls to newGenericArray. It is performed during typer as creation of generic arrays needs a classTag. we rely on implicit search to find one.

    Definition Classes
    Applications
  71. def cookComments(syms: List[Symbol], owner: Symbol)(implicit ctx: Context): Unit

    The Docstrings typer will handle the expansion of @define and <invalid inheritdoc annotation> if there is a DocContext present as a property in the supplied ctx.

    The Docstrings typer will handle the expansion of @define and <invalid inheritdoc annotation> if there is a DocContext present as a property in the supplied ctx.

    It will also type any @usecase available in function definitions.

    Definition Classes
    Docstrings
  72. 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.

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

    Definition Classes
    Namer
  73. def defDefSig(ddef: ast.untpd.DefDef, sym: Symbol)(implicit ctx: Context): Type

    The type signature of a DefDef with given symbol

    The type signature of a DefDef with given symbol

    Definition Classes
    Namer
  74. def enclosingClassNamed(name: TypeName, pos: Position)(implicit ctx: Context): Symbol

    The enclosing class with given name; error if none exists

    The enclosing class with given name; error if none exists

    Definition Classes
    Namer
  75. def encodeName(tree: ast.untpd.NameTree)(implicit ctx: Context): ast.untpd.NameTree

    Attributes
    protected
  76. def ensureAccessible(tpe: Type, superAccess: Boolean, pos: Position)(implicit ctx: Context): Type

    If tpe is a named type, check that its denotation is accessible in the current context.

    If tpe is a named type, check that its denotation is accessible in the current context. Return the type with those alternatives as denotations which are accessible.

    Also performs the following normalizations on the type tpe. (1) parameter accessors are always dereferenced. (2) if the owner of the denotation is a package object, it is assured that the package object shows up as the prefix.

    Definition Classes
    TypeAssigner
  77. def ensureConstrCall(cls: ClassSymbol, parents: List[ast.tpd.Tree])(implicit ctx: Context): List[ast.tpd.Tree]

    If this is a real class, make sure its first parent is a constructor call.

    If this is a real class, make sure its first parent is a constructor call. Cannot simply use a type. Overridden in ReTyper.

  78. def ensureFirstIsClass(parents: List[ast.tpd.Tree], pos: Position)(implicit ctx: Context): List[ast.tpd.Tree]

    Ensure that first parent tree refers to a real class.

  79. def ensureFirstIsClass(parents: List[Type])(implicit ctx: Context): List[Type]

    Ensure that the first type in a list of parent types Ps points to a non-trait class.

    Ensure that the first type in a list of parent types Ps points to a non-trait class. If that's not already the case, add one. The added class type CT is determined as follows. First, let C be the unique class such that

    • there is a parent P_i such that P_i derives from C, and
    • for every class D: If some parent P_j, j <= i derives from D, then C derives from D. Then, let CT be the smallest type which
    • has C as its class symbol, and
    • for all parents P_i: If P_i derives from C then P_i <:< CT.
  80. def ensureNoLocalRefs(tree: ast.tpd.Tree, pt: Type, localSyms: ⇒ List[Symbol], forcedDefined: Boolean = false)(implicit ctx: Context): ast.tpd.Tree

    Check that expression's type can be expressed without references to locally defined symbols.

    Check that expression's type can be expressed without references to locally defined symbols. The following two remedies are tried before giving up:

    1. If the expected type of the expression is fully defined, pick it as the type of the result expressed by adding a type ascription. 2. If (1) fails, force all type variables so that the block's type is fully defined and try again.
    Attributes
    protected
  81. 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.

    Definition Classes
    Namer
  82. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  84. def escapingRefs(block: ast.tpd.Tree, localSyms: ⇒ List[Symbol])(implicit ctx: Context): Set[NamedType]

  85. def expand(tree: ast.untpd.Tree)(implicit ctx: Context): Unit

    Expand tree and store in expandedTree

    Expand tree and store in expandedTree

    Definition Classes
    Namer
  86. def expanded(tree: ast.untpd.Tree)(implicit ctx: Context): ast.untpd.Tree

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

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

    Definition Classes
    Namer
  87. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  89. def handleUnexpectedFunType(tree: ast.untpd.Apply, fun: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Overridden in ReTyper to handle primitive operations that can be generated after erasure

    Overridden in ReTyper to handle primitive operations that can be generated after erasure

    Attributes
    protected
    Definition Classes
    Applications
  90. def harmonize(trees: List[ast.tpd.Tree])(implicit ctx: Context): List[ast.tpd.Tree]

    If trees all have numeric value types, and they do not have all the same type, pick a common numeric supertype and convert all trees to this type.

    If trees all have numeric value types, and they do not have all the same type, pick a common numeric supertype and convert all trees to this type.

    Definition Classes
    Applications
  91. def harmonizeTypes(tpes: List[Type])(implicit ctx: Context): List[Type]

    If all types are numeric value types, and they are not all the same type, pick a common numeric supertype and return it instead of every original type.

    If all types are numeric value types, and they are not all the same type, pick a common numeric supertype and return it instead of every original type.

    Definition Classes
    Applications
  92. def hashCode(): Int

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

    A new context that summarizes an import statement

    A new context that summarizes an import statement

    Definition Classes
    Namer
  94. def inClassContext(selfInfo: DotClass)(implicit ctx: Context): Context

    A new context for the interior of a class

    A new context for the interior of a class

    Definition Classes
    Namer
  95. def index(stats: List[ast.untpd.Tree])(implicit ctx: Context): Context

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

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

    Definition Classes
    Namer
  96. 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

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

    Definition Classes
    Namer
  97. 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

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

    Definition Classes
    Namer
  98. def inferImplicit(pt: Type, argument: ast.tpd.Tree, pos: Position)(implicit ctx: Context): SearchResult

    Find an implicit parameter or conversion.

    Find an implicit parameter or conversion.

    pt

    The expected type of the parameter or conversion.

    argument

    If an implicit conversion is searched, the argument to which it should be applied, EmptyTree otherwise.

    pos

    The position where errors should be reported. !!! todo: catch potential cycles

    Definition Classes
    Implicits
  99. def inferImplicitArg(formal: Type, error: ((String) ⇒ String) ⇒ Unit, pos: Position)(implicit ctx: Context): ast.tpd.Tree

    Find an implicit argument for parameter formal.

    Find an implicit argument for parameter formal.

    error

    An error handler that gets an error message parameter which is itself parameterized by another string, indicating where the implicit parameter is needed

    Definition Classes
    Implicits
  100. def inferView(from: ast.tpd.Tree, to: Type)(implicit ctx: Context): SearchResult

    Find an implicit conversion to apply to given tree from so that the result is compatible with type to.

    Find an implicit conversion to apply to given tree from so that the result is compatible with type to.

    Definition Classes
    Implicits
  101. def inlineExpansion(mdef: ast.tpd.DefDef)(implicit ctx: Context): List[ast.tpd.Tree]

    Given an inline method mdef, the method rewritten so that its body uses accessors to access non-public members, followed by the accessor definitions.

    Given an inline method mdef, the method rewritten so that its body uses accessors to access non-public members, followed by the accessor definitions. Overwritten in Retyper to return mdef unchanged.

    Attributes
    protected
  102. 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.

    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.

    Definition Classes
    Namer
  103. def isApplicable(tp: Type, args: List[Type], resultType: Type)(implicit ctx: Context): Boolean

    Is given type applicable to argument types args, possibly after inserting an apply?

    Is given type applicable to argument types args, possibly after inserting an apply?

    resultType

    The expected result type of the application

    Definition Classes
    Applications
  104. def isApplicable(tp: Type, targs: List[Type], args: List[ast.tpd.Tree], resultType: Type)(implicit ctx: Context): Boolean

    Is given type applicable to type arguments targs and argument trees args, possibly after inserting an apply?

    Is given type applicable to type arguments targs and argument trees args, possibly after inserting an apply?

    resultType

    The expected result type of the application

    Definition Classes
    Applications
  105. def isApplicable(methRef: TermRef, args: List[Type], resultType: Type)(implicit ctx: Context): Boolean

    Is given method reference applicable to argument types args?

    Is given method reference applicable to argument types args?

    resultType

    The expected result type of the application

    Definition Classes
    Applications
  106. def isApplicable(methRef: TermRef, targs: List[Type], args: List[ast.tpd.Tree], resultType: Type)(implicit ctx: Context): Boolean

    Is given method reference applicable to type arguments targs and argument trees args?

    Is given method reference applicable to type arguments targs and argument trees args?

    resultType

    The expected result type of the application

    Definition Classes
    Applications
  107. def isAsGood(alt1: TermRef, alt2: TermRef)(implicit ctx: Context): Boolean

    In a set of overloaded applicable alternatives, is alt1 at least as good as alt2? alt1 and alt2 are non-overloaded references.

    In a set of overloaded applicable alternatives, is alt1 at least as good as alt2? alt1 and alt2 are non-overloaded references.

    Definition Classes
    Applications
  108. def isCompatible(tp: Type, pt: Type)(implicit ctx: Context): Boolean

    A type tp is compatible with a type pt if one of the following holds:

    A type tp is compatible with a type pt if one of the following holds:

    1. tp is a subtype of pt 2. pt is by name parameter type, and tp is compatible with its underlying type 3. there is an implicit conversion from tp to pt. 4. tp is a numeric subtype of pt (this case applies even if implicit conversions are disabled)
    Definition Classes
    Compatibility
  109. def isDirectlyApplicable(methRef: TermRef, targs: List[Type], args: List[ast.tpd.Tree], resultType: Type)(implicit ctx: Context): Boolean

    Is given method reference applicable to type arguments targs and argument trees args without inferring views?

    Is given method reference applicable to type arguments targs and argument trees args without inferring views?

    resultType

    The expected result type of the application

    Definition Classes
    Applications
  110. 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
    Definition Classes
    Namer
  111. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  112. def localContext(tree: ast.untpd.Tree, owner: Symbol)(implicit ctx: Context): FreshContext

    A fresh local context with given tree and owner.

    A fresh local context with given tree and owner. Owner might not exist (can happen for self valdefs), in which case no owner is set in result context

    Attributes
    protected
  113. def localDummy(cls: ClassSymbol, impl: ast.untpd.Template)(implicit ctx: Context): Symbol

  114. def localTyper(sym: Symbol): Typer

    Attributes
    protected
  115. 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.

    Definition Classes
    Namer
  116. def narrowMostSpecific(alts: List[TermRef])(implicit ctx: Context): List[TermRef]

    Definition Classes
    Applications
  117. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  118. 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.

    Definition Classes
    Namer
  119. def newLikeThis: Typer

  120. def normalizedCompatible(tp: Type, pt: Type)(implicit ctx: Context): Boolean

    Test compatibility after normalization in a fresh typerstate.

    Test compatibility after normalization in a fresh typerstate.

    Definition Classes
    Compatibility
  121. final def notify(): Unit

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

    Definition Classes
    AnyRef
  123. def qualifyingClass(tree: ast.untpd.Tree, qual: Name, packageOK: Boolean)(implicit ctx: 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).

    Definition Classes
    TypeAssigner
  124. final def reallyExists(denot: Denotation)(implicit ctx: 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.

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

    Record sym as the symbol defined by tree

    Record sym as the symbol defined by tree

    Definition Classes
    Namer
  126. def resolveOverloaded(alts: List[TermRef], pt: Type)(implicit ctx: Context): List[TermRef]

    Resolve overloaded alternative alts, given expected type pt and possibly also type argument targs that need to be applied to each alternative to form the method type.

    Resolve overloaded alternative alts, given expected type pt and possibly also type argument targs that need to be applied to each alternative to form the method type. todo: use techniques like for implicits to pick candidates quickly?

    Definition Classes
    Applications
  127. def retrieveSym(tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

    Retrieve symbol attached to given tree

    Retrieve symbol attached to given tree

    Attributes
    protected
  128. 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.

    Definition Classes
    Namer
  129. def selectionType(site: Type, name: Name, pos: Position)(implicit ctx: Context): Type

    The type of a selection with name of a tree with type site.

    The type of a selection with name of a tree with type site.

    Definition Classes
    TypeAssigner
  130. def seqToRepeated(tree: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    TypeAssigner
  131. def setDocstring(sym: Symbol, tree: ast.untpd.Tree)(implicit ctx: Context): Unit

    Definition Classes
    Namer
  132. def symbolOfTree(tree: ast.untpd.Tree)(implicit ctx: Context): Symbol

    The symbol of the given expanded tree.

    The symbol of the given expanded tree.

    Definition Classes
    Namer
  133. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  134. def synthesizedClassTag(formal: Type, pos: Position)(implicit ctx: Context): ast.tpd.Tree

    If formal is of the form ClassTag[T], where T is a class type, synthesize a class tag for T.

    If formal is of the form ClassTag[T], where T is a class type, synthesize a class tag for T.

    Definition Classes
    Implicits
  135. def toString(): String

    Definition Classes
    AnyRef → Any
  136. def tryAlternatively[T](op1: (Context) ⇒ T)(op2: (Context) ⇒ T)(implicit ctx: Context): T

    Try op1, if there are errors, try op2, if op2 also causes errors, fall back to errors and result of op1.

  137. def tryEither[T](op: (Context) ⇒ T)(fallBack: (T, TyperState) ⇒ T)(implicit ctx: Context): T

  138. def tryInsertApplyOrImplicit(tree: ast.tpd.Tree, pt: ProtoType)(fallBack: (ast.tpd.Tree, TyperState) ⇒ ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Add apply node or implicit conversions.

    Add apply node or implicit conversions. Two strategies are tried, and the first that is successful is picked. If neither of the strategies are successful, continues with fallBack.

    1st strategy: Try to insert .apply so that the result conforms to prototype pt. 2nd strategy: If tree is a select qual.name, try to insert an implicit conversion around the qualifier part qual so that the result conforms to the expected type with wildcard result type.

  139. def tryInsertImplicitOnQualifier(tree: ast.tpd.Tree, pt: Type)(implicit ctx: Context): Option[ast.tpd.Tree]

    If this tree is a select node qual.name, try to insert an implicit conversion c around qual so that c(qual).name conforms to pt.

  140. def typeDefSig(tdef: ast.untpd.TypeDef, sym: Symbol, tparamSyms: List[TypeSymbol])(implicit ctx: Context): Type

    Definition Classes
    Namer
  141. def typed(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

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

    Definition Classes
    Namer
  143. def typedAheadExpr(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    Namer
  144. def typedAheadType(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    Namer
  145. def typedAlternative(tree: ast.untpd.Alternative, pt: Type)(implicit ctx: Context): ast.tpd.Alternative

  146. def typedAndTypeTree(tree: ast.untpd.AndTypeTree)(implicit ctx: Context): ast.tpd.AndTypeTree

  147. def typedAnnotated(tree: ast.untpd.Annotated, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  148. def typedAnnotation(annot: ast.untpd.Tree)(implicit ctx: Context): ast.tpd.Tree

  149. def typedAppliedTypeTree(tree: ast.untpd.AppliedTypeTree)(implicit ctx: Context): ast.tpd.Tree

  150. def typedApply(tree: ast.untpd.Apply, pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    Applications
  151. def typedAsFunction(tree: PostfixOp, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  152. def typedAssign(tree: ast.untpd.Assign, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  153. def typedBind(tree: ast.untpd.Bind, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  154. def typedBlock(tree: ast.untpd.Block, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  155. def typedBlockStats(stats: List[ast.untpd.Tree])(implicit ctx: Context): (Context, List[ast.tpd.Tree])

  156. def typedByNameTypeTree(tree: ast.untpd.ByNameTypeTree)(implicit ctx: Context): ast.tpd.ByNameTypeTree

  157. def typedCase(tree: ast.untpd.CaseDef, pt: Type, selType: Type, gadtSyms: Set[Symbol])(implicit ctx: Context): ast.tpd.CaseDef

    Type a case.

    Type a case. Overridden in ReTyper, that's why it's separate from typedCases.

  158. def typedCases(cases: List[ast.untpd.CaseDef], selType: Type, pt: Type)(implicit ctx: Context): List[ast.tpd.CaseDef]

  159. def typedClassDef(cdef: ast.untpd.TypeDef, cls: ClassSymbol)(implicit ctx: Context): TypeDef[Type]

  160. def typedClosure(tree: ast.untpd.Closure, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  161. def typedDefDef(ddef: ast.untpd.DefDef, sym: Symbol)(implicit ctx: Context): DefDef[Type]

  162. def typedDynamicApply(tree: ast.untpd.Apply, pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Translate selection that does not typecheck according to the normal rules into a applyDynamic/applyDynamicNamed.

    Translate selection that does not typecheck according to the normal rules into a applyDynamic/applyDynamicNamed. foo.bar(baz0, baz1, ...) ~~> foo.applyDynamic(bar)(baz0, baz1, ...) foo.bar[T0, ...](baz0, baz1, ...) ~~> foo.applyDynamic[T0, ...](bar)(baz0, baz1, ...) foo.bar(x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed("bar")(("x", bazX), ("y", bazY), ("", baz), ...) foo.bar[T0, ...](x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed[T0, ...]("bar")(("x", bazX), ("y", bazY), ("", baz), ...)

    Definition Classes
    Dynamic
  163. def typedDynamicAssign(tree: ast.untpd.Assign, pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Translate selection that does not typecheck according to the normal rules into a updateDynamic.

    Translate selection that does not typecheck according to the normal rules into a updateDynamic. foo.bar = baz ~~> foo.updateDynamic(bar)(baz)

    Definition Classes
    Dynamic
  164. def typedDynamicSelect(tree: ast.untpd.Select, targs: List[ast.tpd.Tree], pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Translate selection that does not typecheck according to the normal rules into a selectDynamic.

    Translate selection that does not typecheck according to the normal rules into a selectDynamic. foo.bar ~~> foo.selectDynamic(bar) foo.bar[T0, ...] ~~> foo.selectDynamic[T0, ...](bar)

    Note: inner part of translation foo.bar(baz) = quux ~~> foo.selectDynamic(bar).update(baz, quux) is achieved through an existing transformation of in typedAssign [foo.bar(baz) = quux ~~> foo.bar.update(baz, quux)].

    Definition Classes
    Dynamic
  165. def typedExpr(tree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

  166. def typedFunction(tree: Function, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  167. def typedIdent(tree: ast.untpd.Ident, pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Attribute an identifier consisting of a simple name or wildcard

    Attribute an identifier consisting of a simple name or wildcard

    tree

    The tree representing the identifier. Transformations: (1) Prefix class members with this. (2) Change imported symbols to selections. (3) Change pattern Idents id (but not wildcards) to id @ _

  168. def typedIf(tree: ast.untpd.If, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  169. def typedImport(imp: ast.untpd.Import, sym: Symbol)(implicit ctx: Context): ast.tpd.Import

  170. def typedInlined(tree: ast.untpd.Inlined, pt: Type)(implicit ctx: Context): ast.tpd.Inlined

  171. def typedLiteral(tree: ast.untpd.Literal)(implicit ctx: Context): ThisTree[Type]

  172. def typedMatch(tree: ast.untpd.Match, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  173. def typedNamedArg(tree: ast.untpd.NamedArg, pt: Type)(implicit ctx: Context): NamedArg[Type]

  174. def typedNamedArgs(args: List[ast.untpd.Tree])(implicit ctx: Context): List[NamedArg[Type]]

    Definition Classes
    Applications
  175. def typedNew(tree: ast.untpd.New, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  176. def typedOrTypeTree(tree: ast.untpd.OrTypeTree)(implicit ctx: Context): ast.tpd.OrTypeTree

  177. def typedPackageDef(tree: ast.untpd.PackageDef)(implicit ctx: Context): ast.tpd.Tree

  178. def typedPattern(tree: ast.untpd.Tree, selType: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

  179. def typedPolyTypeTree(tree: ast.untpd.PolyTypeTree)(implicit ctx: Context): ast.tpd.Tree

  180. def typedRefinedTypeTree(tree: ast.untpd.RefinedTypeTree)(implicit ctx: Context): ast.tpd.RefinedTypeTree

  181. def typedReturn(tree: ast.untpd.Return)(implicit ctx: Context): ast.tpd.Return

  182. def typedSelect(tree: ast.untpd.Select, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  183. def typedSeqLiteral(tree: ast.untpd.SeqLiteral, pt: Type)(implicit ctx: Context): ast.tpd.SeqLiteral

  184. def typedSingletonTypeTree(tree: ast.untpd.SingletonTypeTree)(implicit ctx: Context): ast.tpd.SingletonTypeTree

  185. def typedStats(stats: List[ast.untpd.Tree], exprOwner: Symbol)(implicit ctx: Context): List[ast.tpd.Tree]

  186. def typedSuper(tree: ast.untpd.Super, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  187. def typedThis(tree: ast.untpd.This)(implicit ctx: Context): ast.tpd.Tree

  188. def typedThrow(tree: Throw)(implicit ctx: Context): ast.tpd.Tree

  189. def typedTrees(trees: List[ast.untpd.Tree])(implicit ctx: Context): List[ast.tpd.Tree]

  190. def typedTry(tree: ast.untpd.Try, pt: Type)(implicit ctx: Context): ast.tpd.Try

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

  192. def typedTypeApply(tree: ast.untpd.TypeApply, pt: Type)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    Applications
  193. def typedTypeBoundsTree(tree: ast.untpd.TypeBoundsTree)(implicit ctx: Context): ast.tpd.TypeBoundsTree

  194. def typedTypeDef(tdef: ast.untpd.TypeDef, sym: Symbol)(implicit ctx: Context): ast.tpd.Tree

  195. def typedTypeTree(tree: ast.untpd.TypeTree, pt: Type)(implicit ctx: Context): ast.tpd.TypeTree

  196. def typedTyped(tree: ast.untpd.Typed, pt: Type)(implicit ctx: Context): ast.tpd.Tree

  197. def typedTypedSplice(tree: TypedSplice)(implicit ctx: Context): ast.tpd.Tree

  198. def typedUnApply(tree: ast.untpd.UnApply, selType: Type)(implicit ctx: Context): ast.tpd.UnApply

    A typed unapply hook, can be overridden by re any-typers between frontend and pattern matcher.

    A typed unapply hook, can be overridden by re any-typers between frontend and pattern matcher.

    Definition Classes
    Applications
  199. def typedUnApply(tree: ast.untpd.Apply, selType: Type)(implicit ctx: Context): ast.tpd.Tree

    Definition Classes
    Applications
  200. def typedUnadapted(initTree: ast.untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): ast.tpd.Tree

  201. def typedValDef(vdef: ast.untpd.ValDef, sym: Symbol)(implicit ctx: Context): ValDef[Type]

  202. 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

    Definition Classes
    Namer
  203. def viewExists(from: Type, to: Type)(implicit ctx: Context): Boolean

    Definition Classes
    Implicits
  204. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Docstrings

Inherited from Checking

Inherited from Dynamic

Inherited from Implicits

Inherited from Applications

Inherited from Compatibility

Inherited from TypeAssigner

Inherited from Namer

Inherited from AnyRef

Inherited from Any

Ungrouped