Class

scala.reflect.macros

Universe

Related Doc: package macros

Permalink

abstract class Universe extends api.Universe

EXPERIMENTAL

The refinement of scala.reflect.api.Universe for the use by macro writers.

This universe provides mutability for reflection artifacts (e.g. macros can change types of compiler trees, add annotation to symbols representing definitions, etc) and exposes some internal compiler functionality such as Symbol.deSkolemize or Tree.attachments.

Source
Universe.scala
Linear Supertypes
Type Hierarchy
Content Hierarchy
Universe.TypeSymbolUniverse.ClassSymbolUniverse.FreeTypeSymbolUniverse.TermSymbolUniverse.MethodSymbolUniverse.ModuleSymbolUniverse.FreeTermSymbolUniverse.SingletonTypeUniverse.ThisTypeUniverse.SingleTypeUniverse.SuperTypeUniverse.ConstantTypeUniverse.TypeRefUniverse.CompoundTypeUniverse.RefinedTypeUniverse.ClassInfoTypeUniverse.MethodTypeUniverse.NullaryMethodTypeUniverse.PolyTypeUniverse.ExistentialTypeUniverse.AnnotatedTypeUniverse.TypeBoundsUniverse.BoundedWildcardTypeUniverse.MemberScopeUniverse.TermTreeUniverse.LabelDefUniverse.BlockUniverse.AlternativeUniverse.StarUniverse.UnApplyUniverse.FunctionUniverse.AssignUniverse.AssignOrNamedArgUniverse.IfUniverse.MatchUniverse.ReturnUniverse.TryUniverse.ThrowUniverse.NewUniverse.TypedUniverse.GenericApplyUniverse.SuperUniverse.ThisUniverse.LiteralUniverse.ReferenceToBoxedUniverse.TypTreeUniverse.SingletonTypeTreeUniverse.SelectFromTypeTreeUniverse.CompoundTypeTreeUniverse.AppliedTypeTreeUniverse.TypeBoundsTreeUniverse.ExistentialTypeTreeUniverse.TypeTreeUniverse.SymTreeUniverse.RefTreeUniverse.DefTreeUniverse.ImportUniverse.TemplateUniverse.NameTreeUniverse.SelectUniverse.IdentUniverse.MemberDefUniverse.BindUniverse.PackageDefUniverse.ImplDefUniverse.ValOrDefDefUniverse.TypeDefUniverse.ClassDefUniverse.ModuleDefUniverse.ValDefUniverse.DefDefUniverse.CaseDefUniverse.TypeApplyUniverse.ApplyUniverse.AnnotatedUniverse.TreeCopierUniverse.LiteralArgumentUniverse.ArrayArgumentUniverse.NestedArgumentUniverse.TypeTag[T]Universe.ModuleMirrorUniverse.ClassMirrorUniverse.RuntimeMirrorLiftableUnliftableUniverse.SymbolUniverse.TypeUniverse.ScopeUniverse.TreeUniverse.TreeCopierOpsUniverse.JavaArgumentUniverse.WeakTypeTag[T]Universe.TemplateMirrorUniverse.ReflectiveMirrorUniverse.StandardLiftableInstancesUniverse.StandardUnliftableInstances
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Universe
  2. Universe
  3. Internals
  4. Quasiquotes
  5. Liftables
  6. Printers
  7. Mirrors
  8. StandardLiftables
  9. StandardNames
  10. StandardDefinitions
  11. ImplicitTags
  12. TypeTags
  13. Exprs
  14. Positions
  15. Annotations
  16. Constants
  17. Trees
  18. Names
  19. Scopes
  20. FlagSets
  21. Types
  22. Symbols
  23. AnyRef
  24. 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

Macro Specific Additions

  1. abstract type CompilationUnit <: CompilationUnitContextApi

    Permalink

    The type of compilation units.

    The type of compilation units.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) c.enclosingTree-style APIs are now deprecated; consult the scaladoc for more information

    See also

    scala.reflect.macros.Enclosures

  2. abstract type Run <: RunContextApi

    Permalink

    The type of compilation runs.

    The type of compilation runs.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) c.enclosingTree-style APIs are now deprecated; consult the scaladoc for more information

    See also

    scala.reflect.macros.Enclosures

Universe

  1. macro def reify[T](expr: T): Expr[T]

    Permalink

    Use reify to produce the abstract syntax tree representing a given Scala expression.

    Use reify to produce the abstract syntax tree representing a given Scala expression.

    For example:

    val five = reify{ 5 }         // Literal(Constant(5))
    reify{ 5.toString }           // Apply(Select(Literal(Constant(5)), TermName("toString")), List())
    reify{ five.splice.toString } // Apply(Select(five, TermName("toString")), List())

    The produced tree is path dependent on the Universe reify was called from.

    Use scala.reflect.api.Exprs#Expr.splice to embed an existing expression into a reify call. Use Expr to turn a Tree into an expression that can be spliced.

    Definition Classes
    Universe

API

  1. trait AlternativeApi extends Universe.TermTreeApi

    Permalink

    The API that all alternatives support

    The API that all alternatives support

    Definition Classes
    Trees
  2. trait AnnotatedApi extends Universe.TreeApi

    Permalink

    The API that all annotateds support

    The API that all annotateds support

    Definition Classes
    Trees
  3. trait AnnotatedTypeApi extends Universe.TypeApi

    Permalink

    The API that all annotated types support.

    The API that all annotated types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  4. trait AnnotationApi extends AnyRef

    Permalink

    The API of Annotation instances.

    The API of Annotation instances. The main source of information about annotations is the scala.reflect.api.Annotations page.

    Definition Classes
    Annotations
  5. trait AppliedTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all applied type trees support

    The API that all applied type trees support

    Definition Classes
    Trees
  6. trait ApplyApi extends Universe.GenericApplyApi

    Permalink

    The API that all applies support

    The API that all applies support

    Definition Classes
    Trees
  7. trait AssignApi extends Universe.TermTreeApi

    Permalink

    The API that all assigns support

    The API that all assigns support

    Definition Classes
    Trees
  8. trait AssignOrNamedArgApi extends Universe.TermTreeApi

    Permalink

    The API that all assigns support

    The API that all assigns support

    Definition Classes
    Trees
  9. trait BindApi extends Universe.DefTreeApi

    Permalink

    The API that all binds support

    The API that all binds support

    Definition Classes
    Trees
  10. trait BlockApi extends Universe.TermTreeApi

    Permalink

    The API that all blocks support

    The API that all blocks support

    Definition Classes
    Trees
  11. trait BoundedWildcardTypeApi extends Universe.TypeApi

    Permalink

    The API that all this types support.

    The API that all this types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  12. trait CaseDefApi extends Universe.TreeApi

    Permalink

    The API that all case defs support

    The API that all case defs support

    Definition Classes
    Trees
  13. trait ClassDefApi extends Universe.ImplDefApi

    Permalink

    The API that all class defs support

    The API that all class defs support

    Definition Classes
    Trees
  14. trait ClassInfoTypeApi extends Universe.TypeApi

    Permalink

    The API that all class info types support.

    The API that all class info types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  15. trait ClassSymbolApi extends Universe.TypeSymbolApi

    Permalink

    The API of class symbols.

    The API of class symbols. The main source of information about symbols is the Symbols page.

    Class Symbol defines isXXX test methods such as isPublic or isFinal, params and returnType methods for method symbols, baseClasses for class symbols and so on. Some of these methods don't make sense for certain subclasses of Symbol and return NoSymbol, Nil or other empty values.

    Definition Classes
    Symbols
  16. trait CompoundTypeApi extends AnyRef

    Permalink

    Has no special methods.

    Has no special methods. Is here to provides erased identity for CompoundType.

    Definition Classes
    Types
  17. trait CompoundTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all compound type trees support

    The API that all compound type trees support

    Definition Classes
    Trees
  18. abstract class ConstantApi extends AnyRef

    Permalink

    The API of Constant instances.

    The API of Constant instances.

    Definition Classes
    Constants
  19. trait ConstantTypeApi extends Universe.TypeApi

    Permalink

    The API that all constant types support.

    The API that all constant types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  20. trait DefDefApi extends Universe.ValOrDefDefApi

    Permalink

    The API that all def defs support

    The API that all def defs support

    Definition Classes
    Trees
  21. trait DefTreeApi extends Universe.SymTreeApi with Universe.NameTreeApi

    Permalink

    The API that all def trees support

    The API that all def trees support

    Definition Classes
    Trees
  22. trait DefinitionsApi extends Universe.StandardTypes

    Permalink

    Defines standard symbols (and types via its base trait).

    Defines standard symbols (and types via its base trait).

    Definition Classes
    StandardDefinitions
  23. trait ExistentialTypeApi extends Universe.TypeApi

    Permalink

    The API that all existential types support.

    The API that all existential types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  24. trait ExistentialTypeTreeApi extends Universe.TypTreeApi

    Permalink

    The API that all existential type trees support

    The API that all existential type trees support

    Definition Classes
    Trees
  25. trait FunctionApi extends Universe.TermTreeApi with Universe.SymTreeApi

    Permalink

    The API that all functions support

    The API that all functions support

    Definition Classes
    Trees
  26. trait GenericApplyApi extends Universe.TermTreeApi

    Permalink

    The API that all applies support

    The API that all applies support

    Definition Classes
    Trees
  27. trait IdentApi extends Universe.RefTreeApi

    Permalink

    The API that all idents support

    The API that all idents support

    Definition Classes
    Trees
  28. trait IfApi extends Universe.TermTreeApi

    Permalink

    The API that all ifs support

    The API that all ifs support

    Definition Classes
    Trees
  29. trait ImplDefApi extends Universe.MemberDefApi

    Permalink

    The API that all impl defs support

    The API that all impl defs support

    Definition Classes
    Trees
  30. trait ImportApi extends Universe.SymTreeApi

    Permalink

    The API that all imports support

    The API that all imports support

    Definition Classes
    Trees
  31. trait ImportSelectorApi extends AnyRef

    Permalink

    The API that all import selectors support

    The API that all import selectors support

    Definition Classes
    Trees
  32. trait LabelDefApi extends Universe.DefTreeApi with Universe.TermTreeApi

    Permalink

    The API that all label defs support

    The API that all label defs support

    Definition Classes
    Trees
  33. trait LiteralApi extends Universe.TermTreeApi

    Permalink

    The API that all literals support

    The API that all literals support

    Definition Classes
    Trees
  34. trait MatchApi extends Universe.TermTreeApi

    Permalink

    The API that all matches support

    The API that all matches support

    Definition Classes
    Trees
  35. trait MemberDefApi extends Universe.DefTreeApi

    Permalink

    The API that all member defs support

    The API that all member defs support

    Definition Classes
    Trees
  36. trait MemberScopeApi extends Universe.ScopeApi

    Permalink

    The API that all member scopes support

    The API that all member scopes support

    Definition Classes
    Scopes
  37. trait MethodSymbolApi extends Universe.TermSymbolApi

    Permalink

    The API of method symbols.

    The API of method symbols. The main source of information about symbols is the Symbols page.

    Class Symbol defines isXXX test methods such as isPublic or isFinal, params and returnType methods for method symbols, baseClasses for class symbols and so on. Some of these methods don't make sense for certain subclasses of Symbol and return NoSymbol, Nil or other empty values.

    Definition Classes
    Symbols
  38. trait MethodTypeApi extends Universe.TypeApi

    Permalink

    The API that all method types support.

    The API that all method types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  39. abstract class ModifiersApi extends AnyRef

    Permalink

    The API that all Modifiers support

    The API that all Modifiers support

    Definition Classes
    Trees
  40. trait ModuleDefApi extends Universe.ImplDefApi

    Permalink

    The API that all module defs support

    The API that all module defs support

    Definition Classes
    Trees
  41. trait ModuleSymbolApi extends Universe.TermSymbolApi

    Permalink

    The API of module symbols.

    The API of module symbols. The main source of information about symbols is the Symbols page.

    Class Symbol defines isXXX test methods such as isPublic or isFinal, params and returnType methods for method symbols, baseClasses for class symbols and so on. Some of these methods don't make sense for certain subclasses of Symbol and return NoSymbol, Nil or other empty values.

    Definition Classes
    Symbols
  42. abstract class NameApi extends AnyRef

    Permalink

    The API of Name instances.

    The API of Name instances.

    Definition Classes
    Names
  43. trait NameTreeApi extends Universe.TreeApi

    Permalink

    The API that all name trees support

    The API that all name trees support

    Definition Classes
    Trees
  44. trait NamesApi extends AnyRef

    Permalink

    Defines standard names, common for term and type names: These can be accessed via the nme and tpnme members.

    Defines standard names, common for term and type names: These can be accessed via the nme and tpnme members.

    Definition Classes
    StandardNames
  45. trait NewApi extends Universe.TermTreeApi

    Permalink

    The API that all news support

    The API that all news support

    Definition Classes
    Trees
  46. trait NullaryMethodTypeApi extends Universe.TypeApi

    Permalink

    The API that all nullary method types support.

    The API that all nullary method types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  47. trait PackageDefApi extends Universe.MemberDefApi

    Permalink

    The API that all package defs support

    The API that all package defs support

    Definition Classes
    Trees
  48. trait PolyTypeApi extends Universe.TypeApi

    Permalink

    The API that all polymorphic types support.

    The API that all polymorphic types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  49. trait RefTreeApi extends Universe.SymTreeApi with Universe.NameTreeApi

    Permalink

    The API that all ref trees support

    The API that all ref trees support

    Definition Classes
    Trees
  50. trait RefinedTypeApi extends Universe.TypeApi

    Permalink

    The API that all refined types support.

    The API that all refined types support. The main source of information about types is the scala.reflect.api.Types page.

    Definition Classes
    Types
  51. trait ReturnApi extends Universe.TermTreeApi

    Permalink

    The API that all returns support

    The API that all returns support

    Definition Classes
    Trees