scala.reflect

# macros

#### package macros

The base package for Scala macros.

Macros are functions that are called by the compiler during compilation. Within these functions the programmer has access to compiler APIs exposed in scala.reflect.macros.Context. For example, it is possible to generate, analyze and typecheck code.

See the Macros Guide on how to get started with Scala macros.

Linear Supertypes
AnyRef, Any
Content Hierarchy Learn more about scaladoc diagrams
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. macros
2. AnyRef
3. Any

1. Hide All
2. Show all

Learn more about member selection
Visibility

1. Public
2. All

### Type Members

1. #### trait Aliases extends AnyRef

   A slice of the Scala macros context that defines shorthands for the most frequently used types and functions of the underlying compiler universe.

2. #### abstract class Attachments extends AnyRef

   Attachments provide a way to associate custom metadata with symbols and trees.

3. #### trait Context extends Aliases with Enclosures with Names with Reifiers with FrontEnds with Infrastructure with Typers with Parsers with Evals with ExprUtils

   The Scala macros context.

4. #### trait Enclosures extends AnyRef

   A slice of the Scala macros context that exposes enclosing trees (method, class, compilation unit and currently compiled application), the enclosing position of the macro expansion, as well as macros and implicits that are currently in-flight.

5. #### trait Evals extends AnyRef

   A slice of the Scala macros context that provides a facility to evaluate trees.

6. #### trait ExprUtils extends AnyRef

   A slice of the Scala macros context that defines shorthands for the most common `Expr`-creating functions.

7. #### trait FrontEnds extends AnyRef

   A slice of the Scala macros context that provides facilities to communicate with the compiler's front end (emit warnings, errors and other sorts of messages).

8. #### trait Infrastructure extends AnyRef

   A slice of the Scala macros context that provides facilities to communicate with the compiler's infrastructure.

9. #### trait Names extends AnyRef

   A slice of the Scala macros context that provides functions that generate unique names.

10. #### case class ParseException(pos: Position, msg: String) extends java.lang.Exception with Product with Serializable

    Indicates an error during scala.reflect.macros.Parsers#parse.

11. #### trait Parsers extends AnyRef

    A slice of the Scala macros context that exposes functions to parse strings with Scala code into trees.

12. #### case class ReificationException(pos: Position, msg: String) extends java.lang.Exception with Product with Serializable

    Indicates an expected error during one of the `reifyXXX` methods in scala.reflect.macros.Reifiers.

13. #### trait Reifiers extends AnyRef

    A slice of the Scala macros context that exposes functions to save reflection artifacts for runtime.

14. #### abstract class TreeBuilder extends AnyRef

    A helper available in scala.reflect.macros.Universe that defines shorthands for the most common tree-creating functions.

15. #### case class TypecheckException(pos: Position, msg: String) extends java.lang.Exception with Product with Serializable

    Indicates an error during one of the methods in scala.reflect.macros.Typers.

16. #### trait Typers extends AnyRef

    A slice of the Scala macros context that partially exposes the type checker to macro writers.

17. #### case class UnexpectedReificationException(pos: Position, msg: String, cause: Throwable = null) extends java.lang.Exception with Product with Serializable

    Indicates an unexpected expected error during one of the `reifyXXX` methods in scala.reflect.macros.Reifiers.

18. #### abstract class Universe extends api.Universe

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

### Inherited from AnyRef

### Inherited from Any

### Ungrouped