Class

scala.reflect.api

Universe

Related Doc: package api

Permalink

abstract class Universe extends Symbols with Types with FlagSets with Scopes with Names with Trees with Constants with Annotations with Positions with Exprs with TypeTags with ImplicitTags with StandardDefinitions with StandardNames with StandardLiftables with Mirrors with Printers with Liftables with Quasiquotes with Internals

EXPERIMENTAL

Universe provides a complete set of reflection operations which make it possible for one to reflectively inspect Scala type relations, such as membership or subtyping.

scala.reflect.api.Universe has two specialized sub-universes for different scenarios. scala.reflect.api.JavaUniverse adds operations that link symbols and types to the underlying classes and runtime values of a JVM instance-- this can be thought of as the Universe that should be used for all typical use-cases of Scala reflection. scala.reflect.macros.Universe adds operations which allow macros to access selected compiler data structures and operations-- this type of Universe should only ever exist within the implementation of a Scala macro.

Universe can be thought of as the entry point to Scala reflection. It mixes-in, and thus provides an interface to the following main types:

To obtain a Universe to use with Scala runtime reflection, simply make sure to use or import scala.reflect.runtime.universe._

scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._

scala> typeOf[List[Int]]
res0: reflect.runtime.universe.Type = scala.List[Int]

scala> typeOf[Either[String, Int]]
res1: reflect.runtime.universe.Type = scala.Either[String,Int]

To obtain a Universe for use within a Scala macro, use scala.reflect.macros.blackbox.Context#universe. or scala.reflect.macros.whitebox.Context#universe. For example:

def printf(format: String, params: Any*): Unit = macro impl
def impl(c: Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = {
  import c.universe._
  ...
}

For more information about Universes, see the Reflection Guide: Universes

Source
Universe.scala
Linear Supertypes
Known Subclasses
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. Internals
  3. Quasiquotes
  4. Liftables
  5. Printers
  6. Mirrors
  7. StandardLiftables
  8. StandardNames
  9. StandardDefinitions
  10. ImplicitTags
  11. TypeTags
  12. Exprs
  13. Positions
  14. Annotations
  15. Constants
  16. Trees
  17. Names
  18. Scopes
  19. FlagSets
  20. Types
  21. Symbols
  22. AnyRef
  23. 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

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.

Annotations

  1. abstract type Annotation >: Null <: Universe.AnnotationApi

    Permalink

    Information about an annotation.

    Information about an annotation.

    Definition Classes
    Annotations
  2. abstract type ArrayArgument >: Null <: Universe.ArrayArgumentApi with Universe.JavaArgument

    Permalink

    An array argument to a Java annotation as in @Target(value={TYPE,FIELD,METHOD,PARAMETER})

    An array argument to a Java annotation as in @Target(value={TYPE,FIELD,METHOD,PARAMETER})

    Definition Classes
    Annotations
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use Annotation.tree to inspect annotation arguments

  3. abstract type JavaArgument >: Null <: Universe.JavaArgumentApi

    Permalink

    A Java annotation argument

    A Java annotation argument

    Definition Classes
    Annotations
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use Annotation.tree to inspect annotation arguments

  4. abstract type LiteralArgument >: Null <: Universe.LiteralArgumentApi with Universe.JavaArgument

    Permalink

    A literal argument to a Java annotation as "Use X instead" in @Deprecated("Use X instead")

    A literal argument to a Java annotation as "Use X instead" in @Deprecated("Use X instead")

    Definition Classes
    Annotations
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use Annotation.tree to inspect annotation arguments

  5. abstract type NestedArgument >: Null <: Universe.NestedArgumentApi with Universe.JavaArgument

    Permalink

    A nested annotation argument to a Java annotation as @Nested in @Outer(@Nested).

    A nested annotation argument to a Java annotation as @Nested in @Outer(@Nested).

    Definition Classes
    Annotations
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use Annotation.tree to inspect annotation arguments

Constants

  1. abstract type Constant >: Null <: Universe.ConstantApi

    Permalink

    This "virtual" case class represents the reflection interface for literal expressions which can not be further broken down or evaluated, such as "true", "0", "classOf[List]".

    This "virtual" case class represents the reflection interface for literal expressions which can not be further broken down or evaluated, such as "true", "0", "classOf[List]". Such values become parts of the Scala abstract syntax tree representing the program. The constants correspond to section 6.24 "Constant Expressions" of the Scala Language Specification.

    Such constants are used to represent literals in abstract syntax trees (the scala.reflect.api.Trees#Literal node) and literal arguments for Java class file annotations (the scala.reflect.api.Annotations#LiteralArgument class).

    Constants can be matched against and can be constructed directly, as if they were case classes:

    assert(Constant(true).value == true)
    Constant(true) match {
      case Constant(s: String) =>  println("A string: " + s)
      case Constant(b: Boolean) => println("A boolean value: " + b)
      case Constant(x) =>          println("Something else: " + x)
    }

    Constant instances can wrap certain kinds of these expressions:

    1. Literals of primitive value classes (Byte, Short, Int, Long, Float, Double, Char, Boolean and Unit) - represented directly as the corresponding type
    2. String literals - represented as instances of the String.
    3. References to classes, typically constructed with scala.Predef#classOf - represented as types.
    4. References to enumeration values - represented as symbols.

    Class references are represented as instances of scala.reflect.api.Types#Type (because when the Scala compiler processes a class reference, the underlying runtime class might not yet have been compiled). To convert such a reference to a runtime class, one should use the runtimeClass method of a mirror such as RuntimeMirror (the simplest way to get such a mirror is using scala.reflect.runtime.currentMirror).

    Enumeration value references are represented as instances of scala.reflect.api.Symbols#Symbol, which on JVM point to methods that return underlying enum values. To inspect an underlying enumeration or to get runtime value of a reference to an enum, one should use a scala.reflect.api.Mirrors#RuntimeMirror (the simplest way to get such a mirror is again scala.reflect.runtime.package#currentMirror).

    Usage example:

    enum JavaSimpleEnumeration { FOO, BAR }
    
    import java.lang.annotation.*;
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.TYPE})
    public @interface JavaSimpleAnnotation {
      Class<?> classRef();
      JavaSimpleEnumeration enumRef();
    }
    
    @JavaSimpleAnnotation(
      classRef = JavaAnnottee.class,
      enumRef = JavaSimpleEnumeration.BAR
    )
    public class JavaAnnottee {}
    import scala.reflect.runtime.universe._
    import scala.reflect.runtime.{currentMirror => cm}
    
    object Test extends App {
      val jann = typeOf[JavaAnnottee].typeSymbol.annotations(0).javaArgs
      def jarg(name: String) = jann(TermName(name)) match {
        // Constant is always wrapped into a Literal or LiteralArgument tree node
        case LiteralArgument(ct: Constant) => value
        case _ => sys.error("Not a constant")
      }
    
      val classRef = jarg("classRef").value.asInstanceOf[Type]
                                             // ideally one should match instead of casting
      println(showRaw(classRef))             // TypeRef(ThisType(), JavaAnnottee, List())
      println(cm.runtimeClass(classRef))     // class JavaAnnottee
    
      val enumRef = jarg("enumRef").value.asInstanceOf[Symbol]
                                             // ideally one should match instead of casting
      println(enumRef)                       // value BAR
    
      val siblings = enumRef.owner.info.decls
      val enumValues = siblings.filter(sym => sym.isVal && sym.isPublic)
      println(enumValues)                    // Scope{
                                             //   final val FOO: JavaSimpleEnumeration;
                                             //   final val BAR: JavaSimpleEnumeration
                                             // }
    
      // doesn't work because of https://issues.scala-lang.org/browse/SI-6459
      // val enumValue = mirror.reflectField(enumRef.asTerm).get
      val enumClass = cm.runtimeClass(enumRef.owner.asClass)
      val enumValue = enumClass.getDeclaredField(enumRef.name.toString).get(null)
      println(enumValue)                     // BAR
    }
    Definition Classes
    Constants

Definitions

  1. trait StandardTypes extends AnyRef

    Permalink

    Defines standard types.

    Defines standard types.

    Definition Classes
    StandardDefinitions
  1. abstract val definitions: DefinitionsApi

    Permalink

    A value containing all standard definitions in DefinitionsApi

    A value containing all standard definitions in DefinitionsApi

    Definition Classes
    StandardDefinitions

Expressions

  1. trait Expr[+T] extends Equals with Serializable

    Permalink

    Expr wraps an abstract syntax tree and tags it with its type.

    Expr wraps an abstract syntax tree and tags it with its type. The main source of information about exprs is the scala.reflect.api.Exprs page.

    Definition Classes
    Exprs
  1. object Expr extends Serializable

    Permalink

    Constructor/Extractor for Expr.

    Constructor/Extractor for Expr.

    Can be useful, when having a tree and wanting to splice it in reify call, in which case the tree first needs to be wrapped in an expr.

    The main source of information about exprs is the scala.reflect.api.Exprs page.

    Definition Classes
    Exprs

Flags

  1. trait FlagOps extends Any

    Permalink

    The API of FlagSet instances.

    The API of FlagSet instances. The main source of information about flag sets is the scala.reflect.api.FlagSets page.

    Definition Classes
    FlagSets
  2. abstract type FlagSet

    Permalink

    An abstract type representing sets of flags (like private, final, etc.) that apply to definition trees and symbols

    An abstract type representing sets of flags (like private, final, etc.) that apply to definition trees and symbols

    Definition Classes
    FlagSets
  3. trait FlagValues extends AnyRef

    Permalink

    All possible values that can constitute flag sets.

    All possible values that can constitute flag sets. The main source of information about flag sets is the scala.reflect.api.FlagSets page.

    Definition Classes
    FlagSets
  1. abstract val Flag: FlagValues

    Permalink

    A module that contains all possible values that can constitute flag sets.

    A module that contains all possible values that can constitute flag sets.

    Definition Classes
    FlagSets
  2. abstract val NoFlags: FlagSet

    Permalink

    The empty set of flags

    The empty set of flags

    Definition Classes
    FlagSets
  3. implicit abstract def addFlagOps(left: FlagSet): FlagOps

    Permalink

    The API of FlagSet instances.

    The API of FlagSet instances.

    Definition Classes
    FlagSets

Internal

  1. abstract type Compat <: CompatApi

    Permalink

    Definition Classes
    Internals
    See also

    compat

  2. trait CompatApi extends AnyRef

    Permalink

    Definition Classes
    Internals
    See also

    compat

  3. class CompatToken extends AnyRef

    Permalink

    Presence of an implicit value of this type in scope indicates that source compatibility with Scala 2.10 has been enabled.

    Presence of an implicit value of this type in scope indicates that source compatibility with Scala 2.10 has been enabled.

    Definition Classes
    Internals
    Annotations
    @implicitNotFound( ... )
  4. abstract type FreeTermSymbol >: Null <: Universe.FreeTermSymbolApi with Universe.TermSymbol

    Permalink

    The type of free terms introduced by reification.

    The type of free terms introduced by reification.

    Definition Classes
    Internals
  5. trait FreeTermSymbolApi extends Universe.TermSymbolApi

    Permalink

    The API of free term symbols.

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

    $SYMACCESSORS

    Definition Classes
    Internals
  6. abstract type FreeTypeSymbol >: Null <: Universe.FreeTypeSymbolApi with Universe.TypeSymbol

    Permalink

    The type of free types introduced by reification.

    The type of free types introduced by reification.

    Definition Classes
    Internals
  7. trait FreeTypeSymbolApi extends Universe.TypeSymbolApi

    Permalink

    The API of free type symbols.

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

    $SYMACCESSORS

    Definition Classes
    Internals
  8. trait Importer extends AnyRef

    Permalink

    This trait provides support for importers, a facility to migrate reflection artifacts between universes.

    This trait provides support for importers, a facility to migrate reflection artifacts between universes. Note: this trait should typically be used only rarely.

    Reflection artifacts, such as Symbols and Types, are contained in Universes. Typically all processing happens within a single Universe (e.g. a compile-time macro Universe or a runtime reflection Universe), but sometimes there is a need to migrate artifacts from one Universe to another. For example, runtime compilation works by importing runtime reflection trees into a runtime compiler universe, compiling the importees and exporting the result back.

    Reflection artifacts are firmly grounded in their Universes, which is reflected by the fact that types of artifacts from different universes are not compatible. By using Importers, however, they be imported from one universe into another. For example, to import foo.bar.Baz from the source Universe to the target Universe, an importer will first check whether the entire owner chain exists in the target Universe. If it does, then nothing else will be done. Otherwise, the importer will recreate the entire owner chain and will import the corresponding type signatures into the target Universe.

    Since importers match Symbol tables of the source and the target Universes using plain string names, it is programmer's responsibility to make sure that imports don't distort semantics, e.g., that foo.bar.Baz in the source Universe means the same that foo.bar.Baz does in the target Universe.

    Example

    Here's how one might implement a macro that performs compile-time evaluation of its argument by using a runtime compiler to compile and evaluate a tree that belongs to a compile-time compiler:

    def staticEval[T](x: T) = macro staticEval[T]
    
    def staticEval[T](c: scala.reflect.macros.blackbox.Context)(x: c.Expr[T]) = {
      // creates a runtime reflection universe to host runtime compilation
      import scala.reflect.runtime.{universe => ru}
      val mirror = ru.runtimeMirror(c.libraryClassLoader)
      import scala.tools.reflect.ToolBox
      val toolBox = mirror.mkToolBox()
    
      // runtime reflection universe and compile-time macro universe are different
      // therefore an importer is needed to bridge them
      // currently mkImporter requires a cast to correctly assign the path-dependent types
      val importer0 = ru.internal.mkImporter(c.universe)
      val importer = importer0.asInstanceOf[ru.internal.Importer { val from: c.universe.type }]
    
      // the created importer is used to turn a compiler tree into a runtime compiler tree
      // both compilers use the same classpath, so semantics remains intact
      val imported = importer.importTree(tree)
    
      // after the tree is imported, it can be evaluated as usual
      val tree = toolBox.untypecheck(imported.duplicate)
      val valueOfX = toolBox.eval(imported).asInstanceOf[T]
      ...
    }
    Definition Classes
    Internals
  9. abstract type Internal <: InternalApi

    Permalink

    Definition Classes
    Internals
    See also

    InternalApi

  10. trait InternalApi extends AnyRef

    Permalink

    Reflection API exhibits a tension inherent to experimental things: on the one hand we want it to grow into a beautiful and robust API, but on the other hand we have to deal with immaturity of underlying mechanisms by providing not very pretty solutions to enable important use cases.

    Reflection API exhibits a tension inherent to experimental things: on the one hand we want it to grow into a beautiful and robust API, but on the other hand we have to deal with immaturity of underlying mechanisms by providing not very pretty solutions to enable important use cases.

    In Scala 2.10, which was our first stab at reflection API, we didn't have a systematic approach to dealing with this tension, sometimes exposing too much of internals (e.g. Symbol.deSkolemize) and sometimes exposing too little (e.g. there's still no facility to change owners, to do typing transformations, etc). This resulted in certain confusion with some internal APIs living among public ones, scaring the newcomers, and some internal APIs only available via casting, which requires intimate knowledge of the compiler and breaks compatibility guarantees.

    This led to creation of the internal API module for the reflection API, which provides advanced APIs necessary for macros that push boundaries of the state of the art, clearly demarcating them from the more or less straightforward rest and providing compatibility guarantees on par with the rest of the reflection API (full compatibility within minor releases, best effort towards backward compatibility within major releases, clear replacement path in case of rare incompatible changes in major releases).

    The internal module itself (the value that implements InternalApi) isn't defined here, in scala.reflect.api.Universe, but is provided on per-implementation basis. Runtime API endpoint (scala.reflect.runtime.universe) provides universe.compat: InternalApi, whereas compile-time API endpoints (instances of scala.reflect.macros.Context) provide c.compat: ContextInternalApi, which extends InternalApi with additional universe-specific and context-specific functionality.

    Definition Classes
    Internals
  11. abstract type ReferenceToBoxed >: Null <: Universe.ReferenceToBoxedApi with Universe.TermTree

    Permalink

    Marks underlying reference to id as boxed.

    Marks underlying reference to id as boxed.

    Precondition: id must refer to a captured variable A reference such marked will refer to the boxed entity, no dereferencing with .elem is done on it. This tree node can be emitted by macros such as reify that call referenceCapturedVariable. It is eliminated in LambdaLift, where the boxing conversion takes place.

    Definition Classes
    Internals
  12. trait ReferenceToBoxedApi extends Universe.TermTreeApi

    Permalink

    The API that all references support

    The API that all references support

    Definition Classes
    Internals
  13. abstract class ReferenceToBoxedExtractor extends AnyRef

    Permalink

    An extractor class to create and pattern match with syntax ReferenceToBoxed(ident).

    An extractor class to create and pattern match with syntax ReferenceToBoxed(ident). This AST node does not have direct correspondence to Scala code, and is emitted by macros to reference capture vars directly without going through elem.

    For example:

    var x = ... fun { x }

    Will emit:

    Ident(x)

    Which gets transformed to:

    Select(Ident(x), "elem")

    If ReferenceToBoxed were used instead of Ident, no transformation would be performed.

    Definition Classes
    Internals
  14. trait ReificationSupportApi extends AnyRef

    Permalink

    This is an internal implementation class.

    This is an internal implementation class.

    Definition Classes
    Internals
  1. implicit abstract val FreeTermSymbolTag: ClassTag[FreeTermSymbol]

    Permalink

    Tag that preserves the identity of FreeTermSymbol in the face of erasure.

    Tag that preserves the identity of FreeTermSymbol in the face of erasure. Can be used for pattern matching, instance tests, serialization and the like.

    Definition Classes
    Internals
  2. implicit abstract val FreeTypeSymbolTag: ClassTag[FreeTypeSymbol]

    Permalink

    Tag that preserves the identity of FreeTermSymbol in the face of erasure.

    Tag that preserves the identity of FreeTermSymbol in the face of erasure. Can be used for pattern matching, instance tests, serialization and the like.

    Definition Classes
    Internals
  3. abstract val ReferenceToBoxed: ReferenceToBoxedExtractor

    Permalink

    The constructor/extractor for ReferenceToBoxed instances.

    The constructor/extractor for ReferenceToBoxed instances.

    Definition Classes
    Internals
  4. implicit abstract val ReferenceToBoxedTag: ClassTag[ReferenceToBoxed]

    Permalink

    Tag that preserves the identity of ReferenceToBoxed in the face of erasure.

    Tag that preserves the identity of ReferenceToBoxed in the face of erasure. Can be used for pattern matching, instance tests, serialization and the like.

    Definition Classes
    Internals
  5. abstract val compat: Compat

    Permalink

    Provides enrichments to ensure source compatibility between Scala 2.10 and Scala 2.11.

    Provides enrichments to ensure source compatibility between Scala 2.10 and Scala 2.11. If in your reflective program for Scala 2.10 you've used something that's now become an internal API, a single compat._ import will fix things for you.

    Definition Classes
    Internals
  6. abstract val internal: Internal

    Permalink

    Definition Classes
    Internals
    See also

    InternalApi

Mirrors

  1. trait ClassMirror extends Universe.TemplateMirror

    Permalink

    A mirror that reflects the instance parts of a runtime class.

    A mirror that reflects the instance parts of a runtime class. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  2. trait FieldMirror extends AnyRef

    Permalink

    A mirror that reflects a field.

    A mirror that reflects a field. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  3. trait InstanceMirror extends AnyRef

    Permalink

    A mirror that reflects a runtime value.

    A mirror that reflects a runtime value. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  4. trait MethodMirror extends AnyRef

    Permalink

    A mirror that reflects a method.

    A mirror that reflects a method. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  5. abstract type Mirror >: Null <: api.Mirror[Universe.this.type]

    Permalink

    The base type of all mirrors of this universe.

    The base type of all mirrors of this universe.

    This abstract type conforms the base interface for all mirrors defined in scala.reflect.api.Mirror and is gradually refined in specific universes (e.g. Mirror of a scala.reflect.api.JavaUniverse is capable of reflection).

    Definition Classes
    Mirrors
  6. trait ModuleMirror extends Universe.TemplateMirror

    Permalink

    A mirror that reflects a Scala object definition or the static parts of a runtime class.

    A mirror that reflects a Scala object definition or the static parts of a runtime class. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  7. trait ReflectiveMirror extends api.Mirror[Mirrors.this.type]

    Permalink

    A mirror that reflects instances and static classes.

    A mirror that reflects instances and static classes. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  8. abstract type RuntimeClass >: Null <: AnyRef

    Permalink

    Abstracts the runtime representation of a class on the underlying platform.

    Abstracts the runtime representation of a class on the underlying platform.

    Definition Classes
    Mirrors
  9. trait RuntimeMirror extends api.Mirror[Mirrors.this.type] with Universe.ReflectiveMirror

    Permalink

    The API of a mirror for a reflective universe.

    The API of a mirror for a reflective universe. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  10. trait TemplateMirror extends AnyRef

    Permalink

    A mirror that reflects the instance or static parts of a runtime class.

    A mirror that reflects the instance or static parts of a runtime class. See the overview page for details on how to use runtime reflection.

    Definition Classes
    Mirrors
  1. abstract val rootMirror: Mirror

    Permalink

    The root mirror of this universe.

    The root mirror of this universe. This mirror contains standard Scala classes and types such as Any, AnyRef, AnyVal, Nothing, Null, and all classes loaded from scala-library, which are shared across all mirrors within the enclosing universe.

    Definition Classes
    Mirrors

Names

  1. abstract type Name >: Null <: NameApi

    Permalink

    The abstract type of names.

    The abstract type of names.

    Definition Classes
    Names
  2. abstract type TermName >: Null <: TermNameApi with Name

    Permalink

    The abstract type of names representing types.

    The abstract type of names representing types.

    Definition Classes
    Names
  3. abstract type TypeName >: Null <: TypeNameApi with Name

    Permalink

    The abstract type of names representing terms.

    The abstract type of names representing terms.

    Definition Classes
    Names
  1. abstract def newTermName(s: String): TermName

    Permalink

    Create a new term name.

    Create a new term name.

    Definition Classes
    Names
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11.0) Use TermName instead

  2. abstract def newTypeName(s: String): TypeName

    Permalink

    Creates a new type name.

    Creates a new type name.

    Definition Classes