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

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. 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.

  13. val ctx: C

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

    >: Nothing <: Any

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

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

    Definition Classes
    AnyRef → Any
  17. 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].

  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. 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.

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

  21. def freshValDef(tpe: scala.reflect.macros.Universe.Type, sym: Symbol): scala.reflect.macros.Universe.ValDef

    Constructs a new, local ValDef with the given Type, a unique name, the same position as sym, and an empty implementation (no rhs).

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

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

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

  25. def hashCode(): Int

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

    The type representing the type constructor [X] X

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

  28. final def isInstanceOf[T0]: Boolean

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

    Modifiers for a local val.

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

    Constructs a ValDef with local modifiers and a unique name.

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

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

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

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

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

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

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

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

  36. final def notify(): Unit

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

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

  39. def refVal(vd: scala.reflect.macros.Universe.ValDef, pos: scala.reflect.macros.Universe.Position): Tree

    Create a Tree that references the val represented by vd.

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

    A Type that references the given type variable.

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

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

    Returns the Symbol that references the statically accessible singleton i.

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

    Definition Classes
    AnyRef
  44. def toString(): String

    Definition Classes
    AnyRef → Any
  45. def transformWrappers(t: Tree, subWrapper: (String, scala.reflect.macros.Universe.Type, 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>)

  46. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped