Class/Object

retypecheck

ReTyper

Related Docs: object ReTyper | package retypecheck

Permalink

class ReTyper[+C <: Context] extends AnyRef

heavy wizardry to fight the dark forces of Scala type-checking in macros

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReTyper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ReTyper(c: C)

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val c: C

    Permalink
  6. def cleanModifiers(mods: scala.reflect.macros.Universe.Modifiers, removeFlags: scala.reflect.macros.Universe.FlagSet = NoFlags): scala.reflect.macros.Universe.Modifiers

    Permalink

    Cleans the flag set of the given modifiers.

    Cleans the flag set of the given modifiers.

    The type-checking process annotates definitions with various flags. Some of them can also be inserted by user-code or even have a corresponding Scala language construct, but others are only used by the type-checker. Certain flags can interfere with type-checking and cause it to fail. Those flags can be safely removed and will be re-inserted during type-checking when needed.

    This method eliminates some problematic cases.

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. def createTypeTree(tpe: scala.reflect.macros.Universe.Type, pos: scala.reflect.macros.Universe.Position, owners: Set[scala.reflect.macros.Universe.Symbol]): scala.reflect.macros.Universe.Tree

    Permalink
  9. def createTypeTree(tpe: scala.reflect.macros.Universe.Type, pos: scala.reflect.macros.Universe.Position): scala.reflect.macros.Universe.Tree

    Permalink

    Creates an AST representing the given type.

    Creates an AST representing the given type.

    The type-checking process creates synthetic type trees and it is possible to insert trees with type information, but it is not easily possible to create an AST for a given type.

    This method attempts to create such an AST, which is persistent across type-checking and un-type-checking.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def fixTypedAnnotteeSymbols(annottee: scala.reflect.macros.Universe.Tree): Unit

    Permalink

    Corrects the symbols for the given tree that has a macro annotation which invoked the type-checker on the tree.

    Corrects the symbols for the given tree that has a macro annotation which invoked the type-checker on the tree.

    Type-checking ASTs that represent Scala objects in a macro annotation may lead to recursive expansion of the same tree (which the macro annotation needs to handle). The symbols that the type-checker associates to the tree can then originate from different expansions.

    This method tries to correct the symbols in the tree, such that the same entities are associated to the same symbol.

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  19. def retypecheck(tree: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Permalink

    Re-type-checks the given tree, i.e., first un-type-checks it and then type-checks it again using untypecheck and typecheck, respectively.

  20. def retypecheckAll(tree: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Permalink

    Re-type-checks the given tree resetting all symbols using the org.scalamacros.resetallattrs library, i.e., first un-type-checks it and then type-checks it again using untypecheckAll and typecheck, respectively.

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

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. def typecheck(tree: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Permalink

    Type-checks the given tree.

    Type-checks the given tree. If type-checking fails, aborts the macro expansion issuing the type-checking error.

    The type-checking process distorts certain ASTs (such as representations of extractors, lazy values or case classes) in a way that they cannot be type-checked again. The issue is described in SI-5464.

  24. def untypecheck(tree: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Permalink

    Un-type-checks the given tree.

    Un-type-checks the given tree.

    The type-checking process distorts certain ASTs (such as representations of extractors, lazy values or case classes) in a way that they cannot be type-checked again. The issue is described in SI-5464.

    This method tries to restore the AST to a form, which can be type-checked again.

  25. def untypecheckAll(tree: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Permalink

    Un-type-checks the given tree resetting all symbols using the org.scalamacros.resetallattrs library.

    Un-type-checks the given tree resetting all symbols using the org.scalamacros.resetallattrs library.

    The type-checking process distorts certain ASTs (such as representations of extractors, lazy values or case classes) in a way that they cannot be type-checked again. The issue is described in SI-5464.

    This method tries to restore the AST to a form, which can be type-checked again.

  26. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped