Packages

class Eraser extends Typer

The modifier typer which retypes with erased types.

Source
Erasure.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Eraser
  2. Typer
  3. TyperContextErrors
  4. PatternTyper
  5. Tag
  6. Adaptation
  7. TyperDiagnostics
  8. AnyRef
  9. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Eraser(_context: Erasure.Context)

Value Members

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

    Test two objects for inequality.

    Test two objects for inequality.

    returns

    true if !(this == that), false otherwise.

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

    Equivalent to x.hashCode except for boxed numeric types and null.

    Equivalent to x.hashCode except for boxed numeric types and null. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them. For null returns a hashcode where null.hashCode throws a NullPointerException.

    returns

    a hash value consistent with ==

    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Eraser to any2stringadd[Eraser] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Eraser, B)
    Implicit
    This member is added by an implicit conversion from Eraser to ArrowAssoc[Eraser] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    The expression x == that is equivalent to if (x eq null) that eq null else x.equals(that).

    The expression x == that is equivalent to if (x eq null) that eq null else x.equals(that).

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    Definition Classes
    AnyRef → Any
  6. def adapt(tree: Global.Tree, mode: Mode, pt: Global.Type, original: Global.Tree = EmptyTree): Global.Tree

    A replacement for the standard typer's adapt method.

    A replacement for the standard typer's adapt method.

    Attributes
    protected
    Definition Classes
    EraserTyper
  7. def adaptAfterOverloadResolution(tree: Global.Tree, mode: Mode, pt: Global.Type = WildcardType, original: Global.Tree = EmptyTree): Global.Tree
    Definition Classes
    Typer
  8. def adaptCase(cdef: Global.CaseDef, mode: Mode, tpe: Global.Type): Global.CaseDef
    Definition Classes
    Typer
  9. def adaptToArguments(qual: Global.Tree, name: Global.Name, args: List[Global.Tree], pt: Global.Type, reportAmbiguous: Boolean = true, saveErrors: Boolean = true): Global.Tree

    Try to apply an implicit conversion to qual to that it contains a method name which can be applied to arguments args with expected type pt.

    Try to apply an implicit conversion to qual to that it contains a method name which can be applied to arguments args with expected type pt. If pt is defined, there is a fallback to try again with pt = ?. This helps avoiding propagating result information too far and solves #1756. If no conversion is found, return qual unchanged.

    Definition Classes
    Typer
  10. def adaptToMember(qual: Global.Tree, searchTemplate: Global.Type, reportAmbiguous: Boolean = true, saveErrors: Boolean = true): Global.Tree
    Definition Classes
    Typer
  11. def adaptToMemberWithArgs(tree: Global.Tree, qual: Global.Tree, name: Global.Name, mode: Mode, reportAmbiguous: Boolean = true, saveErrors: Boolean = true): Global.Tree

    Try to apply an implicit conversion to qual so that it contains a method name.

    Try to apply an implicit conversion to qual so that it contains a method name. If that's ambiguous try taking arguments into account using adaptToArguments.

    Definition Classes
    Typer
  12. def adaptToName(qual: Global.Tree, name: Global.Name): Global.Tree

    Try to apply an implicit conversion to qual to that it contains a member name of arbitrary type.

    Try to apply an implicit conversion to qual to that it contains a member name of arbitrary type. If no conversion is found, return qual unchanged.

    Definition Classes
    Typer
  13. def applyImplicitArgs(fun: Global.Tree): Global.Tree

    Find implicit arguments and pass them to given tree.

    Find implicit arguments and pass them to given tree.

    Definition Classes
    Typer
  14. final def asInstanceOf[T0]: T0

    Cast the receiver object to be of type T0.

    Cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression 1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expression List(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.

    returns

    the receiver object.

    Definition Classes
    Any
    Exceptions thrown

    ClassCastException if the receiver object is not an instance of the erasure of type T0.

  15. def atOwner(tree: Global.Tree, owner: Global.Symbol): Erasure.Typer
    Definition Classes
    Typer
  16. def atOwner(owner: Global.Symbol): Erasure.Typer
    Definition Classes
    Typer
  17. def callToCompanionConstr(context: Erasure.Context, calledFun: Global.Symbol): Boolean
    Definition Classes
    Typer
  18. def canAdaptConstantTypeToLiteral: Boolean

    Overridden to false in scaladoc and/or interactive.

    Overridden to false in scaladoc and/or interactive.

    Definition Classes
    Typer
  19. def canTranslateEmptyListToNil: Boolean
    Definition Classes
    Typer
  20. def checkClassType(tpt: Global.Tree): Boolean

    Check that tpt refers to a non-refinement class type

    Check that tpt refers to a non-refinement class type

    Definition Classes
    Typer
  21. def checkExistentialsFeature(pos: Global.Position, tpe: Global.Type, prefix: String): AnyVal
    Definition Classes
    Typer
  22. def checkFeature(pos: Global.Position, featureTrait: Global.Symbol, construct: ⇒ String = "", immediate: Boolean = false): Boolean

    Check whether feature given by featureTrait is enabled.

    Check whether feature given by featureTrait is enabled. If it is not, issue an error or a warning depending on whether the feature is required.

    construct

    A string expression that is substituted for "#" in the feature description string

    immediate

    When set, feature check is run immediately, otherwise it is run at the end of the typechecking run for the enclosing unit. This is done to avoid potential cyclic reference errors by implicits that are forced too early.

    returns

    if feature check is run immediately: true if feature is enabled, false otherwise if feature check is delayed or suppressed because we are past typer: true

    Definition Classes
    Typer
  23. def checkFinitary(classinfo: Global.ClassInfoType): Unit
    Definition Classes
    Typer
  24. def checkMethodStructuralCompatible(ddef: Global.DefDef): Unit

    Check if a structurally defined method violates implementation restrictions.

    Check if a structurally defined method violates implementation restrictions. A method cannot be called if it is a non-private member of a refinement type and if its parameter's types are any of:

    • the self-type of the refinement
    • a type member of the refinement
    • an abstract type declared outside of the refinement.
    • an instance of a value class Furthermore, the result type may not be a value class either
    Definition Classes
    Typer
  25. def checkNonCyclic(defn: Global.Tree, tpt: Global.Tree): Unit
    Definition Classes
    Typer
  26. def checkNonCyclic(sym: Global.Symbol): Unit
    Definition Classes
    Typer
  27. def checkNonCyclic(pos: Global.Position, tp: Global.Type, lockedSym: Global.Symbol): Boolean
    Definition Classes
    Typer
  28. def checkNonCyclic(pos: Global.Position, tp: Global.Type): Boolean

    Check that type tp is not a subtype of itself.

    Check that type tp is not a subtype of itself.

    Definition Classes
    Typer
  29. def checkParamsConvertible(tree: Global.Tree, tpe0: Global.Type): Unit
    Definition Classes
    Typer
  30. def checkStablePrefixClassType(tpt: Global.Tree): Boolean

    Check that tpt refers to a class type with a stable prefix.

    Check that tpt refers to a class type with a stable prefix.

    Definition Classes
    Typer
  31. def checkValidAdaptation(t: Global.Tree, args: List[Global.Tree]): Boolean
    Definition Classes
    Adaptation
  32. def clone(): AnyRef

    Create a copy of the receiver object.

    Create a copy of the receiver object.

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object.

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
    Note

    not specified by SLS as a member of AnyRef

  33. def computeMacroDefType(ddef: Global.DefDef, pt: Global.Type): Global.Type
    Definition Classes
    Typer
  34. def computeParamAliases(clazz: Global.Symbol, vparamss: List[List[Global.ValDef]], rhs: Global.Tree): Unit

    Enter all aliases of local parameter accessors.

    Enter all aliases of local parameter accessors.

    Definition Classes
    Typer
  35. def computeType(tree: Global.Tree, pt: Global.Type): Global.Type
    Definition Classes
    Typer
  36. final def constrTyperIf(inConstr: Boolean): Erasure.Typer

    The typer for an expression, depending on where we are.

    The typer for an expression, depending on where we are. If we are before a superclass call, this is a typer over a constructor context; otherwise it is the current typer.

    Definition Classes
    Typer
  37. var context: Erasure.Context
    Definition Classes
    Typer
  38. def context1: Erasure.Context
    Definition Classes
    Typer
  39. def cyclicReferenceMessage(sym: Global.Symbol, tree: Global.Tree): Option[String]

    Returns Some(msg) if the given tree is untyped apparently due to a cyclic reference, and None otherwise.

    Returns Some(msg) if the given tree is untyped apparently due to a cyclic reference, and None otherwise.

    Definition Classes
    TyperDiagnostics
  40. def doTypedApply(tree: Global.Tree, fun0: Global.Tree, args: List[Global.Tree], mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  41. def doTypedUnapply(tree: Global.Tree, fun0: Global.Tree, fun: Global.Tree, args: List[Global.Tree], mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    PatternTyper
  42. def dropExistential(tp: Global.Type): Global.Type
    Definition Classes
    Typer
  43. def ensuring(cond: (Eraser) ⇒ Boolean, msg: ⇒ Any): Eraser
    Implicit
    This member is added by an implicit conversion from Eraser to Ensuring[Eraser] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  44. def ensuring(cond: (Eraser) ⇒ Boolean): Eraser
    Implicit
    This member is added by an implicit conversion from Eraser to Ensuring[Eraser] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  45. def ensuring(cond: Boolean, msg: ⇒ Any): Eraser
    Implicit
    This member is added by an implicit conversion from Eraser to Ensuring[Eraser] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  46. def ensuring(cond: Boolean): Eraser
    Implicit
    This member is added by an implicit conversion from Eraser to Ensuring[Eraser] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  47. def enterSym(txt: Erasure.Context, tree: Global.Tree): Erasure.Context
    Attributes
    protected
    Definition Classes
    Typer
  48. def enterSyms(txt: Erasure.Context, trees: List[Global.Tree]): Unit
    Attributes
    protected
    Definition Classes
    Typer
  49. final def eq(arg0: AnyRef): Boolean

    Tests whether the argument (that) is a reference to the receiver object (this).

    Tests whether the argument (that) is a reference to the receiver object (this).

    The eq method implements an equivalence relation on non-null instances of AnyRef, and has three additional properties:

    • It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false.
    • For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false.
    • null.eq(null) returns true.

    When overriding the equals or hashCode methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2), they should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

    returns

    true if the argument is a reference to the receiver object; false otherwise.

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

    The equality method for reference types.

    The equality method for reference types. Default implementation delegates to eq.

    See also equals in scala.Any.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    Definition Classes
    AnyRef → Any
  51. def extractorForUncheckedType(pos: Global.Position, pt: Global.Type): Global.Tree
    Definition Classes
    PatternTyper
  52. def finalize(): Unit

    Called by the garbage collector on the receiver object when there are no more references to the object.

    Called by the garbage collector on the receiver object when there are no more references to the object.

    The details of when and if the finalize method is invoked, as well as the interaction between finalize and non-local returns and exceptions, are all platform dependent.

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
    Note

    not specified by SLS as a member of AnyRef

  53. def finishMethodSynthesis(templ: Global.Template, clazz: Global.Symbol, context: Erasure.Context): Global.Template

    In order to override this in the TreeCheckers Typer so synthetics aren't re-added all the time, it is exposed here the module/class typing methods go through it.

    In order to override this in the TreeCheckers Typer so synthetics aren't re-added all the time, it is exposed here the module/class typing methods go through it. ...but it turns out it's also the ideal spot for namer/typer coordination for the tricky method synthesis scenarios, so we'll make it that.

    Attributes
    protected
    Definition Classes
    Typer
  54. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Eraser to StringFormat[Eraser] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  55. final def getClass(): Class[_]

    Returns the runtime class representation of the object.

    Returns the runtime class representation of the object.

    returns

    a class object corresponding to the runtime type of the receiver.

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

    The hashCode method for reference types.

    The hashCode method for reference types. See hashCode in scala.Any.

    returns

    the hash code value for this object.

    Definition Classes
    AnyRef → Any
  57. val infer: Erasure.Inferencer
    Definition Classes
    Typer
  58. def inferSamType(fun: Global.Tree, pt: Global.Type, mode: Mode): Global.SAMFunction

    Synthesize and type check the implementation of a type with a Single Abstract Method.

    Synthesize and type check the implementation of a type with a Single Abstract Method.

    Based on a type checked Function node { (p1: T1, ..., pN: TN) => body } : S where S is the expected type that defines a single abstract method (call it apply for the example), that has signature (p1: T1', ..., pN: TN'): T', synthesize the instantiation of the following anonymous class

    new S { def apply$body(p1: T1, ..., pN: TN): T = body def apply(p1: T1', ..., pN: TN'): T' = apply$body(p1,..., pN) }

    The apply method is identified by the argument sam; S corresponds to the argument pt, If pt is not fully defined, we derive samClassTpFullyDefined by inferring any unknown type parameters.

    The types T1' ... TN' and T' are derived from the method signature of the sam method, as seen from the fully defined samClassTpFullyDefined.

    The function's body is put in a (static) method in the class definition to enforce scoping. S's members should not be in scope in body. (Putting it in the block outside the class runs into implementation problems described below)

    The restriction on implicit arguments (neither S's constructor, nor sam may take an implicit argument list), is to keep the implementation of type inference (the computation of samClassTpFullyDefined) simple.

    Impl notes:

    • fun has a FunctionType, but the expected type pt is some SAM type -- let's remedy that
    • fun is fully attributed, so we'll have to wrangle some symbols into shape (owner change, vparam syms)
    • after experimentation, it works best to type check function literals fully first and then adapt to a sam type, as opposed to a sam-specific code paths earlier on in type checking (in typedFunction). For one, we want to emit the same bytecode regardless of whether the expected function type is a built-in FunctionN or some SAM type
    Definition Classes
    Typer
  59. def inferView(tree: Global.Tree, from: Global.Type, to: Global.Type, reportAmbiguous: Boolean = true, saveErrors: Boolean = true): Global.Tree

    Infer an implicit conversion (view) between two types.

    Infer an implicit conversion (view) between two types.

    tree

    The tree which needs to be converted.

    from

    The source type of the conversion

    to

    The target type of the conversion

    reportAmbiguous

    Should ambiguous implicit errors be reported? False iff we search for a view to find out whether one type is coercible to another.

    saveErrors

    Should ambiguous and divergent implicit errors that were buffered during the inference of a view be put into the original buffer. False iff we don't care about them.

    Definition Classes
    Typer
  60. def instantiate(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  61. def instantiateExpectingUnit(tree: Global.Tree, mode: Mode): Global.Tree

    If the expected type is Unit: try instantiating type arguments with expected type Unit, but if that fails, try again with pt = WildcardType and discard the expression.

    If the expected type is Unit: try instantiating type arguments with expected type Unit, but if that fails, try again with pt = WildcardType and discard the expression.

    Definition Classes
    Typer
  62. def instantiatePossiblyExpectingUnit(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  63. def isCapturedExistential(sym: Global.Symbol): Boolean
    Definition Classes
    Typer
  64. final def isInstanceOf[T0]: Boolean

    Test whether the dynamic type of the receiver object is T0.

    Test whether the dynamic type of the receiver object is T0.

    Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression 1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    Definition Classes
    Any
  65. val isMonoContext: (Any) ⇒ Boolean
    Definition Classes
    Typer
  66. def isNamedApplyBlock(tree: Global.Tree): Boolean

    Is tree a block created by a named application?

    Is tree a block created by a named application?

    Definition Classes
    Typer
  67. def isReferencedFrom(ctx: Erasure.Context, sym: Global.Symbol): Boolean
    Definition Classes
    Typer
  68. def isStale(sym: Global.Symbol): Boolean

    A symbol is stale if it is toplevel, to be loaded from a classfile, and the classfile is produced from a sourcefile which is compiled in the current run.

    A symbol is stale if it is toplevel, to be loaded from a classfile, and the classfile is produced from a sourcefile which is compiled in the current run.

    Definition Classes
    Typer
  69. def labelTyper(ldef: Global.LabelDef): Erasure.Typer

    The typer for a label definition.

    The typer for a label definition. If this is part of a template we first have to enter the label definition.

    Definition Classes
    Typer
  70. def macroImplementationNotFoundMessage(name: Global.Name): String

    This file will be the death of me.

    This file will be the death of me.

    Attributes
    protected
    Definition Classes
    TyperContextErrors
  71. def member(qual: Global.Tree, name: Global.Name): Global.Symbol

    The member with given name of given qualifier tree

    The member with given name of given qualifier tree

    Definition Classes
    Typer
  72. def missingSelectErrorTree(tree: Global.Tree, qual: Global.Tree, name: Global.Name): Global.Tree
    Definition Classes
    Typer
  73. def namer: Erasure.Namer
    Definition Classes
    Typer
  74. final def ne(arg0: AnyRef): Boolean

    Equivalent to !(this eq that).

    Equivalent to !(this eq that).

    returns

    true if the argument is not a reference to the receiver object; false otherwise.

    Definition Classes
    AnyRef
  75. def needsInstantiation(tparams: List[Global.Symbol], formals: List[Global.Type], args: List[Global.Tree]): Boolean

    Does function need to be instantiated, because a missing parameter in an argument closure overlaps with an uninstantiated formal?

    Does function need to be instantiated, because a missing parameter in an argument closure overlaps with an uninstantiated formal?

    Definition Classes
    Typer
  76. final def notify(): Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Definition Classes
    AnyRef
    Note

    not specified by SLS as a member of AnyRef

  77. final def notifyAll(): Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    Definition Classes
    AnyRef
    Note

    not specified by SLS as a member of AnyRef

  78. def packCaptured(tpe: Global.Type): Global.Type
    Definition Classes
    Typer
  79. def packSymbols(hidden: List[Global.Symbol], tp: Global.Type): Global.Type

    Compute an existential type from raw hidden symbols syms and type tp

    Compute an existential type from raw hidden symbols syms and type tp

    Definition Classes
    Typer
  80. def packedType(tree: Global.Tree, owner: Global.Symbol): Global.Type

    convert local symbols and skolems to existentials

    convert local symbols and skolems to existentials

    Definition Classes
    Typer
  81. def packedTypes(trees: List[Global.Tree]): List[Global.Type]
    Definition Classes
    Typer
  82. def permanentlyHiddenWarning(pos: Global.Position, hidden: Global.Name, defn: Global.Symbol): Unit
    Definition Classes
    TyperDiagnostics
  83. def phasedAppliedType(sym: Global.Symbol, args: List[Global.Type]): Global.Type
    Definition Classes
    Typer
  84. def qualifyingClass(tree: Global.Tree, qual: Global.Name, packageOK: Boolean): Global.Symbol

    The qualifying class of a this or super with prefix qual.

    The qualifying class of a this or super with prefix qual. packageOk is equal false when qualifying class symbol

    Definition Classes
    Typer
  85. def reallyExists(sym: Global.Symbol): Boolean

    Is symbol defined and not stale?

    Is symbol defined and not stale?

    Definition Classes
    Typer
  86. def reenterTypeParams(tparams: List[Global.TypeDef]): List[Global.Symbol]
    Definition Classes
    Typer
  87. def reenterValueParams(vparamss: List[List[Global.ValDef]]): Unit
    Definition Classes
    Typer
  88. def reportTypeError(context0: Erasure.Context, pos: Global.Position, ex: Global.TypeError): Unit

    Report a type error.

    Report a type error.

    pos

    The position where to report the error

    ex

    The exception that caused the error

    Definition Classes
    TyperDiagnostics
  89. def resolveClassTag(pos: Global.Position, tp: Global.Type, allowMaterialization: Boolean = true): Global.Tree

    Finds in scope or materializes a ClassTag.

    Finds in scope or materializes a ClassTag. Should be used instead of ClassManifest every time compiler needs to persist an erasure.

    Once upon a time, we had an ErasureTag which was to ClassTag the same that WeakTypeTag is for TypeTag. However we found out that we don't really need this concept, so it got removed.

    pos

    Position for error reporting. Please, provide meaningful value.

    tp

    Type we're looking a ClassTag for, e.g. resolveClassTag(pos, IntTpe) will look for ClassTag[Int].

    allowMaterialization

    If true (default) then the resolver is allowed to launch materialization macros when there's no class tag in scope. If false then materialization macros are prohibited from running.

    returns

    Tree that represents an scala.reflect.ClassTag for tp if everything is okay. EmptyTree if the result contains unresolved (i.e. not spliced) type parameters and abstract type members. EmptyTree if allowMaterialization is false, and there is no class tag in scope.

    Definition Classes
    Tag
  90. def resolveTypeTag(pos: Global.Position, pre: Global.Type, tp: Global.Type, concrete: Boolean, allowMaterialization: Boolean = true): Global.Tree

    Finds in scope or materializes an WeakTypeTag (if concrete is false) or a TypeTag (if concrete is true).

    Finds in scope or materializes an WeakTypeTag (if concrete is false) or a TypeTag (if concrete is true).

    pos

    Position for error reporting. Please, provide meaningful value.

    pre

    Prefix that represents a universe this type tag will be bound to. If pre is set to NoType, then any type tag in scope will do, regardless of its affiliation. If pre is set to NoType, and tag resolution involves materialization, then mkRuntimeUniverseRef will be used.

    tp

    Type we're looking a TypeTag for, e.g. resolveTypeTag(pos, mkRuntimeUniverseRef, IntTpe, false) will look for scala.reflect.runtime.universe.TypeTag[Int].

    concrete

    If true then the result must not contain unresolved (i.e. not spliced) type parameters and abstract type members. If false then the function will always succeed (abstract types will be reified as free types).

    allowMaterialization

    If true (default) then the resolver is allowed to launch materialization macros when there's no type tag in scope. If false then materialization macros are prohibited from running.

    returns

    Tree that represents a scala.reflect.TypeTag for tp if everything is okay. EmptyTree if concrete is true and the result contains unresolved (i.e. not spliced) type parameters and abstract type members. EmptyTree if allowMaterialization is false, and there is no array tag in scope.

    Definition Classes
    Tag
  91. def rewrappingWrapperTrees(f: (Global.Tree) ⇒ List[Global.Tree]): (Global.Tree) ⇒ List[Global.Tree]

    For flatMapping a list of trees when you want the DocDefs and Annotated to be transparent.

    For flatMapping a list of trees when you want the DocDefs and Annotated to be transparent.

    Definition Classes
    Typer
  92. val runDefinitions: reflect.internal.Definitions.definitions.RunDefinitions
    Definition Classes
    Typer
  93. def samToFunctionType(tp: Global.Type, sam: Global.Symbol = NoSymbol): Global.Type

    Convert a SAM type to the corresponding FunctionType, extrapolating BoundedWildcardTypes in the process (no type precision is lost by the extrapolation, but this facilitates dealing with the types arising from Java's use-site variance).

    Convert a SAM type to the corresponding FunctionType, extrapolating BoundedWildcardTypes in the process (no type precision is lost by the extrapolation, but this facilitates dealing with the types arising from Java's use-site variance).

    Definition Classes
    Typer
  94. def silent[T](op: (Erasure.Typer) ⇒ T, reportAmbiguousErrors: Boolean = context.ambiguousErrors, newtree: Global.Tree = context.tree): Erasure.SilentResult[T]
    Definition Classes
    Typer
  95. def stabilize(tree: Global.Tree, pre: Global.Type, mode: Mode, pt: Global.Type): Global.Tree

    Post-process an identifier or selection node, performing the following:

    Post-process an identifier or selection node, performing the following:

    1. Check that non-function pattern expressions are stable (ignoring volatility concerns -- SI-6815) (and narrow the type of modules: a module reference in a pattern has type Foo.type, not "object Foo") 2. Check that packages and static modules are not used as values 3. Turn tree type into stable type if possible and required by context. 4. Give getClass calls a more precise type based on the type of the target of the call.
    Attributes
    protected
    Definition Classes
    EraserTyper
  96. def stabilizeFun(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  97. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  98. def synthesizePartialFunction(paramName: Global.TermName, paramPos: Global.Position, paramSynthetic: Boolean, tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree

    synthesize and type check a PartialFunction implementation based on the match in tree

    synthesize and type check a PartialFunction implementation based on the match in tree

    param => sel match { cases } becomes:

    new AbstractPartialFunction[$argTp, $matchResTp] { def applyOrElse[A1 <: $argTp, B1 >: $matchResTp]($param: A1, default: A1 => B1): B1 = $selector match { $cases } def isDefinedAt(x: $argTp): Boolean = $selector match { $casesTrue } }

    TODO: it would be nicer to generate the tree specified above at once and type it as a whole, there are two gotchas:

    • matchResTp may not be known until we've typed the match (can only use resTp when it's fully defined),
      • if we typed the match in isolation first, you'd know its result type, but would have to re-jig the owner structure
      • could we use a type variable for matchResTp and backpatch it?
    • occurrences of this in cases or sel must resolve to the this of the class originally enclosing the match, not of the anonymous partial function subclass

    an alternative TODO: add partial function AST node or equivalent and get rid of this synthesis --> do everything in uncurry (or later) however, note that pattern matching codegen is designed to run *before* uncurry

    Definition Classes
    Typer
  99. def toString(): String

    Creates a String representation of this object.

    Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.

    returns

    a String representation of the object.

    Definition Classes
    AnyRef → Any
  100. def transformedOr(tree: Global.Tree, op: ⇒ Global.Tree): Global.Tree
    Definition Classes
    Typer
  101. def transformedOrTyped(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  102. val typeAdapter: Erasure.TypeAdapter
  103. def typed(tree: Global.Tree, mode: Mode): Global.Tree
    Definition Classes
    Typer
  104. def typed(tree: Global.Tree, pt: Global.Type): Global.Tree

    Types expression tree with given prototype pt.

    Types expression tree with given prototype pt.

    Definition Classes
    Typer
  105. def typed(tree: Global.Tree): Global.Tree

    Types expression or definition tree.

    Types expression or definition tree.

    Definition Classes
    Typer
  106. def typed(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  107. def typed1(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree

    A replacement for the standard typer's typed1 method.

    A replacement for the standard typer's typed1 method.

    Definition Classes
    EraserTyper
  108. def typedAnnotation(ann: Global.Tree, mode: Mode = EXPRmode): Global.AnnotationInfo

    Convert an annotation constructor call into an AnnotationInfo.

    Convert an annotation constructor call into an AnnotationInfo.

    Definition Classes
    Typer
  109. def typedArg(arg: Global.Tree, mode: Mode, newmode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  110. def typedArgs(args: List[Global.Tree], mode: Mode): collection.immutable.List[Global.Tree]
    Definition Classes
    Typer
  111. def typedArgsForFormals(args: List[Global.Tree], formals: List[Global.Type], mode: Mode): List[Global.Tree]
    Definition Classes
    PatternTyper
  112. def typedBlock(block0: Global.Block, mode: Mode, pt: Global.Type): Global.Block
    Definition Classes
    Typer
  113. def typedByValueExpr(tree: Global.Tree, pt: Global.Type = WildcardType): Global.Tree
    Definition Classes
    Typer
  114. def typedCase(cdef: Global.CaseDef, pattpe: Global.Type, pt: Global.Type): Global.CaseDef
    Definition Classes
    Typer
  115. def typedCases(cases: List[Global.CaseDef], pattp: Global.Type, pt: Global.Type): List[Global.CaseDef]
    Definition Classes
    Typer
  116. def typedClassDef(cdef: Global.ClassDef): Global.Tree
    Definition Classes
    Typer
  117. def typedClassOf(tree: Global.Tree, tpt: Global.Tree, noGen: Boolean = false): Global.Tree
    Definition Classes
    Typer
  118. def typedConstructorPattern(fun0: Global.Tree, pt: Global.Type): Global.Tree
    Definition Classes
    PatternTyper
  119. def typedDefDef(ddef: Global.DefDef): Global.DefDef
    Definition Classes
    Typer
  120. def typedDocDef(docDef: Global.DocDef, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  121. def typedExistentialTypeTree(tree: Global.ExistentialTypeTree, mode: Mode): Global.Tree
    Attributes
    protected
    Definition Classes
    Typer
  122. def typedHigherKindedType(tree: Global.Tree, mode: Mode): Global.Tree
    Definition Classes
    Typer
  123. def typedHigherKindedType(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree

    Types a higher-kinded type tree -- pt denotes the expected kind and must be one of Kind.WildCard and Kind.FromParams

    Types a higher-kinded type tree -- pt denotes the expected kind and must be one of Kind.WildCard and Kind.FromParams

    Definition Classes
    Typer
  124. def typedImport(imp: Global.Import): Global.Import
    Definition Classes
    Typer
  125. def typedInPattern(tree: Global.Typed, mode: Mode, pt: Global.Type): Global.Tree
    Attributes
    protected
    Definition Classes
    PatternTyper
  126. def typedLabelDef(ldef: Global.LabelDef): Global.LabelDef
    Definition Classes
    Typer
  127. def typedMatch(selector: Global.Tree, cases: List[Global.CaseDef], mode: Mode, pt: Global.Type, tree: Global.Tree = EmptyTree): Global.Match
    Definition Classes
    Typer
  128. def typedModifiers(mods: Global.Modifiers): Global.Modifiers

    Remove definition annotations from modifiers (they have been saved into the symbol's annotations in the type completer / namer)

    Remove definition annotations from modifiers (they have been saved into the symbol's annotations in the type completer / namer)

    However reification does need annotation definitions to proceed. Unfortunately, AnnotationInfo doesn't provide enough info to reify it in general case. The biggest problem is with the "atp: Type" field, which cannot be reified in some situations that involve locally defined annotations. See more about that in Reifiers.scala.

    That's why the original tree gets saved into original field of AnnotationInfo (happens elsewhere). The field doesn't get pickled/unpickled and exists only during a single compilation run. This simultaneously allows us to reify annotations and to preserve backward compatibility.

    Definition Classes
    Typer
  129. def typedModuleDef(mdef: Global.ModuleDef): Global.Tree
    Definition Classes
    Typer
  130. def typedOperator(tree: Global.Tree): Global.Tree

    Types function part of an application

    Types function part of an application

    Definition Classes
    Typer
  131. def typedParentTypes(templ: Global.Template): List[Global.Tree]
    Definition Classes
    Typer
  132. def typedPattern(tree: Global.Tree, pt: Global.Type): Global.Tree

    Types a pattern with prototype pt

    Types a pattern with prototype pt

    Definition Classes
    Typer
  133. def typedPos(pos: Global.Position)(tree: Global.Tree): Global.Tree
    Definition Classes
    Typer
  134. def typedPos(pos: Global.Position, mode: Mode, pt: Global.Type)(tree: Global.Tree): Global.Tree
    Definition Classes
    Typer
  135. def typedQualifier(tree: Global.Tree): Global.Tree
    Definition Classes
    Typer
  136. def typedQualifier(tree: Global.Tree, mode: Mode): Global.Tree

    Types qualifier tree of a select node.

    Types qualifier tree of a select node. E.g. is tree occurs in a context like tree.m.

    Definition Classes
    Typer
  137. def typedQualifier(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree

    Types qualifier tree of a select node.

    Types qualifier tree of a select node. E.g. is tree occurs in a context like tree.m.

    Definition Classes
    Typer
  138. def typedRefinement(templ: Global.Template): Unit
    Definition Classes
    Typer
  139. def typedStarInPattern(tree: Global.Tree, mode: Mode, pt: Global.Type): Global.Tree
    Attributes
    protected
    Definition Classes
    PatternTyper
  140. def typedStats(stats: List[Global.Tree], exprOwner: Global.Symbol): List[Global.Tree]
    Definition Classes
    Typer
  141. def typedTemplate(templ0: Global.Template, parents1: List[Global.Tree]): Global.Template

    Check that inner classes do not inherit from Annotation

    Check that inner classes do not inherit from Annotation

    Definition Classes
    Typer
  142. def typedType(tree: Global.Tree): Global.Tree

    Types a (fully parameterized) type tree

    Types a (fully parameterized) type tree

    Definition Classes
    Typer
  143. def typedType(tree: Global.Tree, mode: Mode): Global.Tree

    Types a (fully parameterized) type tree

    Types a (fully parameterized) type tree

    Definition Classes
    Typer
  144. def typedTypeApply(tree: Global.Tree, mode: Mode, fun: Global.Tree, args: List[Global.Tree]): Global.Tree
    Attributes
    protected
    Definition Classes
    Typer
  145. def typedTypeConstructor(tree: Global.Tree): Global.Tree
    Definition Classes
    Typer
  146. def typedTypeConstructor(tree: Global.Tree, mode: Mode): Global.Tree

    Types a type constructor tree used in a new or supertype

    Types a type constructor tree used in a new or supertype

    Definition Classes
    Typer
  147. def typedTypeDef(tdef: Global.TypeDef): Global.TypeDef
    Definition Classes
    Typer
  148. def typedValDef(vdef: Global.ValDef): Global.ValDef
    Definition Classes
    Typer
  149. final def typerWithCondLocalContext[T](c: ⇒ Erasure.Context)(cond: Boolean)(f: (Erasure.Typer) ⇒ T): T
    Definition Classes
    Typer
    Annotations
    @inline()
  150. final def typerWithLocalContext[T](c: Erasure.Context)(f: (Erasure.Typer) ⇒ T): T
    Definition Classes
    Typer
    Annotations
    @inline()
  151. def validateParentClasses(parents: List[Global.Tree], selfType: Global.Type): Unit

    Check that

    Check that

    • all parents are class types,
    • first parent class is not a mixin; following classes are mixins,
    • final classes are not inherited,

    - sealed classes are only inherited by classes which are nested within definition of base class, or that occur within same statement sequence,

    • self-type of current class is a subtype of self-type of each parent class.
    • no two parents define same symbol.
    Definition Classes
    Typer
  152. def viewExists(from: Global.Type, to: Global.Type): Boolean
    Definition Classes
    Typer
  153. def virtualizedMatch(match_: Global.Match, mode: Mode, pt: Global.Type): Global.Tree
    Definition Classes
    Typer
  154. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  155. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  156. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  157. def warnTypeParameterShadow(tparams: List[Global.TypeDef], sym: Global.Symbol): Unit
    Definition Classes
    TyperDiagnostics
  158. final def withCondConstrTyper[T](inConstr: Boolean)(f: (Erasure.Typer) ⇒ T): T
    Definition Classes
    Typer
    Annotations
    @inline()
  159. def wrapClassTagUnapply(uncheckedPattern: Global.Tree, classTagExtractor: Global.Tree, pt: Global.Type): Global.Tree
    Definition Classes
    PatternTyper
  160. def [B](y: B): (Eraser, B)
    Implicit
    This member is added by an implicit conversion from Eraser to ArrowAssoc[Eraser] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
  161. object TyperErrorGen
    Definition Classes
    TyperContextErrors
  162. object checkDead
    Definition Classes
    TyperDiagnostics
  163. object checkUnused
    Definition Classes
    TyperDiagnostics
  164. object checkNoEscaping extends Global.TypeMap

    Check that type of given tree does not contain local or private components.

    Check that type of given tree does not contain local or private components.

    Definition Classes
    Typer
  165. object dyna
    Definition Classes
    Typer

Inherited from Erasure.Typer

Inherited from Erasure.PatternTyper

Inherited from Erasure.Tag

Inherited from Erasure.Adaptation

Inherited from Erasure.TyperDiagnostics

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Eraser to any2stringadd[Eraser]

Inherited by implicit conversion StringFormat from Eraser to StringFormat[Eraser]

Inherited by implicit conversion Ensuring from Eraser to Ensuring[Eraser]

Inherited by implicit conversion ArrowAssoc from Eraser to ArrowAssoc[Eraser]

Ungrouped