sbt.internal.util.appmacro

ContextUtil

final class ContextUtil[C <: Context] extends AnyRef

Utility methods for macros. Several methods assume that the context's universe is a full compiler (scala.tools.nsc.Global). This is not thread safe due to the underlying Context and related data structures not being thread safe. Use ContextUtil[c.type](c) to construct.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ContextUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContextUtil(ctx: C)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. lazy val alist: Symbol

  7. lazy val alistTC: scala.reflect.macros.Universe.Type

  8. lazy val alistType: C.Type

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def callsiteTyper: (analyzer)#Typer

  11. def changeOwner(tree: Tree, prev: Symbol, next: Symbol): Unit

  12. def checkReferences(defs: Set[Symbol], isWrapper: (String, scala.reflect.macros.Universe.Type, Tree) ⇒ Boolean): (Tree) ⇒ Unit

    A function that checks the provided tree for illegal references to M instances defined in the expression passed to the macro and for illegal dereferencing of M instances.

  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def collectDefs(tree: Tree, isWrapper: (String, scala.reflect.macros.Universe.Type, Tree) ⇒ Boolean): Set[Symbol]

    Collects all definitions in the tree for use in checkReferences.

    Collects all definitions in the tree for use in checkReferences. This excludes definitions in wrapped expressions because checkReferences won't allow nested dereferencing anyway.

  15. def createFunction(params: List[scala.reflect.macros.Universe.ValDef], body: Tree, functionSym: Symbol): Tree

    Creates a Function tree using functionSym as the Symbol and changing initialOwner to functionSym in body.

  16. val ctx: C

  17. def emptyTypeBounds: scala.reflect.macros.Universe.TypeBounds

    >: Nothing <: Any

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

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

    Definition Classes
    AnyRef → Any
  20. def extractTC(tcp: Singleton, name: String)(implicit it: C.TypeTag[tcp]): C.Type

    Returns a Type representing the type constructor tcp.

    Returns a Type representing the type constructor tcp.<name>. For example, given object Demo { type M[x] = List[x] }, the call extractTC(Demo, "M") will return a type representing the type constructor [x] List[x].

  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def freshMethodParameter(tpe: scala.reflect.macros.Universe.Type): scala.reflect.macros.Universe.ValDef

    Constructs a ValDef with a parameter modifier, a unique name, with the provided Type and with an empty rhs.

  23. def freshTermName(prefix: String): scala.reflect.macros.Universe.TermName

    Constructs a unique term name with the given prefix within this Context.

    Constructs a unique term name with the given prefix within this Context. (The current implementation uses Context.fresh, which increments

  24. def freshValDef(tpe: scala.reflect.macros.Universe.Type, pos: scala.reflect.macros.Universe.Position, owner: Symbol): scala.reflect.macros.Universe.ValDef

    Constructs a new, synthetic, local ValDef Type tpe, a unique name, Position pos, an empty implementation (no rhs), and owned by owner.

  25. def functionSymbol(pos: scala.reflect.macros.Universe.Position): Symbol

    Creates a new anonymous function symbol with Position pos.

  26. def functionType(args: List[scala.reflect.macros.Universe.Type], result: scala.reflect.macros.Universe.Type): scala.reflect.macros.Universe.Type

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

    Definition Classes
    AnyRef → Any
  28. def getPos(sym: Symbol): scala.reflect.macros.Universe.Position

  29. val global: universe.type

  30. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  31. lazy val idTC: scala.reflect.macros.Universe.Type

    The type representing the type constructor [X] X

  32. def illegalReference(defs: Set[Symbol], sym: Symbol): Boolean

    A reference is illegal if it is to an M instance defined within the scope of the macro call.

    A reference is illegal if it is to an M instance defined within the scope of the macro call. As an approximation, disallow referenced to any local definitions defs.

  33. val initialOwner: Symbol

  34. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  35. lazy val localModifiers: scala.reflect.macros.Universe.Modifiers

    Modifiers for a local val.

  36. def localValDef(tpt: Tree, rhs: Tree): scala.reflect.macros.Universe.ValDef

    Constructs a ValDef with local modifiers and a unique name.

  37. def method(obj: Symbol, name: String): Symbol

    Returns the symbol for the non-private method named name for the class/module obj.

  38. def mkTuple(args: List[Tree]): Tree

    Constructs a tuple value of the right TupleN type from the provided inputs.

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

    Definition Classes
    AnyRef
  40. def newTCVariable(owner: Symbol): scala.reflect.macros.Universe.TypeSymbol

    Constructs a new, synthetic type variable that is a type constructor.

    Constructs a new, synthetic type variable that is a type constructor. For example, in type Y[L[x]], L is such a type variable.

  41. def newTypeVariable(owner: Symbol, prefix: String = "T0"): scala.reflect.macros.Universe.TypeSymbol

    Creates a new, synthetic type variable with the specified owner.

  42. final def notify(): Unit

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

    Definition Classes
    AnyRef
  44. lazy val parameterModifiers: scala.reflect.macros.Universe.Modifiers

  45. val powerContext: Context

  46. def refVal(replaced: Tree, vd: scala.reflect.macros.Universe.ValDef): Tree

    Create a Tree that references the val represented by vd, copying attributes from replaced.

  47. def refVar(variable: scala.reflect.macros.Universe.TypeSymbol): scala.reflect.macros.Universe.Type

    A Type that references the given type variable.

  48. def select(t: Tree, name: String): Tree

  49. def setInfo[Tree](sym: Symbol, tpe: scala.reflect.macros.Universe.Type): Unit

  50. def setSymbol[Tree](t: Tree, sym: Symbol): Unit

  51. def singleton[T <: Singleton](i: T)(implicit it: C.TypeTag[i.type]): Symbol

    Returns the Symbol that references the statically accessible singleton i.

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

    Definition Classes
    AnyRef
  53. def toString(): String

    Definition Classes
    AnyRef → Any
  54. def transformWrappers(t: Tree, subWrapper: (String, scala.reflect.macros.Universe.Type, Tree, Tree) ⇒ Converted[ctx.type]): Tree

    Substitutes wrappers in tree t with the result of subWrapper.

    Substitutes wrappers in tree t with the result of subWrapper. A wrapper is a Tree of the form f[T](v) for which isWrapper(<Tree of f>, <Underlying Type>, <qual>.target) returns true. Typically, f is a Select or Ident. The wrapper is replaced with the result of subWrapper(<Type of T>, <Tree of v>, <wrapper Tree>)

  55. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped