Class/Object

sbt.internal.util.appmacro

ContextUtil

Related Docs: object ContextUtil | package appmacro

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContextUtil(ctx: 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. lazy val alist: scala.reflect.macros.Universe.Symbol

    Permalink
  5. lazy val alistTC: scala.reflect.macros.Universe.Type

    Permalink
  6. lazy val alistType: C.Type

    Permalink
  7. final def asInstanceOf[T0]: T0

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

    Permalink
  9. def changeOwner(tree: scala.reflect.macros.Universe.Tree, prev: scala.reflect.macros.Universe.Symbol, next: scala.reflect.macros.Universe.Symbol): Unit

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

    Permalink

    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.

  11. def clone(): AnyRef

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

    Permalink

    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.

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

    Permalink

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

  14. val ctx: C

    Permalink
  15. def emptyTypeBounds: scala.reflect.macros.Universe.TypeBounds

    Permalink

    >: Nothing <: Any

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

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

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

    Permalink

    Returns a Type representing the type constructor tcp.<name>.

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

  19. def finalize(): Unit

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

    Permalink

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

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

    Permalink

    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.freshName, which increments

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

    Permalink

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

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

    Permalink

    Creates a new anonymous function symbol with Position pos.

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

    Permalink
  25. final def getClass(): Class[_]

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

    Permalink
  27. val global: universe.type

    Permalink
  28. def hashCode(): Int

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

    Permalink

    The type representing the type constructor [X] X

  30. def illegalReference(defs: Set[scala.reflect.macros.Universe.Symbol], sym: scala.reflect.macros.Universe.Symbol): Boolean

    Permalink

    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.

  31. val initialOwner: scala.reflect.macros.Universe.Symbol

    Permalink
  32. final def isInstanceOf[T0]: Boolean

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

    Permalink

    Modifiers for a local val.

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

    Permalink

    Constructs a ValDef with local modifiers and a unique name.

  35. def method(obj: scala.reflect.macros.Universe.Symbol, name: String): scala.reflect.macros.Universe.Symbol

    Permalink

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

  36. def mkTuple(args: List[scala.reflect.macros.Universe.Tree]): scala.reflect.macros.Universe.Tree

    Permalink

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

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

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

    Permalink

    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.

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

    Permalink

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

  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

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

    Permalink
  43. val powerContext: Context

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

    Permalink

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

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

    Permalink

    A Type that references the given type variable.

  46. def select(t: scala.reflect.macros.Universe.Tree, name: String): scala.reflect.macros.Universe.Tree

    Permalink
  47. def setInfo(sym: scala.reflect.macros.Universe.Symbol, tpe: scala.reflect.macros.Universe.Type): Unit

    Permalink
  48. def setSymbol[_Tree](t: _Tree, sym: scala.reflect.macros.Universe.Symbol): Unit

    Permalink
  49. def singleton[T <: Singleton](i: T)(implicit it: C.TypeTag[i.type]): scala.reflect.macros.Universe.Symbol

    Permalink

    Returns the Symbol that references the statically accessible singleton i.

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

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

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

    Permalink

    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>)

  53. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped