Packages

  • package root
    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package reflect
    Definition Classes
    scala
  • package macros

    EXPERIMENTAL

    EXPERIMENTAL

    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. For example, it is possible to generate, analyze and typecheck code.

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

    Definition Classes
    reflect
  • trait Enclosures extends AnyRef

    EXPERIMENTAL

    EXPERIMENTAL

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

    Starting from Scala 2.11.0, the APIs to get the trees enclosing by the current macro application are deprecated, and the reasons for that are two-fold. Firstly, we would like to move towards the philosophy of locally-expanded macros, as it has proven to be important for understanding of code. Secondly, within the current architecture of scalac, we are unable to have c.enclosingTree-style APIs working robustly. Required changes to the typechecker would greatly exceed the effort that we would like to expend on this feature given the existence of more pressing concerns at the moment. This is somewhat aligned with the overall evolution of macros during the 2.11 development cycle, where we played with c.introduceTopLevel and c.introduceMember, but at the end of the day decided to reject them.

    If you're relying on the now deprecated APIs, consider using the new Internals.ContextInternalApi.enclosingOwner method that can be used to obtain the names of enclosing definitions. Alternatively try reformulating your macros in terms of completely local expansion and/or joining a discussion of a somewhat related potential language feature at https://groups.google.com/forum/#!topic/scala-debate/f4CLmYShX6Q. We also welcome questions and suggestions on our mailing lists, where we would be happy to further discuss this matter.

    Definition Classes
    macros
  • EnclosureException
c

scala.reflect.macros.Enclosures

EnclosureException

case class EnclosureException(expected: Class[_], enclosingTrees: List[blackbox.Context.Tree]) extends Exception with Product with Serializable

Indicates than one of the enclosure methods failed to find a tree of required type among enclosing trees.

Annotations
@deprecated
Deprecated

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

Source
Enclosures.scala
See also

scala.reflect.macros.Enclosures

Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EnclosureException
  2. Product
  3. Equals
  4. Exception
  5. Throwable
  6. Serializable
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new EnclosureException(expected: Class[_], enclosingTrees: List[blackbox.Context.Tree])

Value Members

  1. final def addSuppressed(arg0: java.lang.Throwable): Unit
    Definition Classes
    Throwable
  2. val enclosingTrees: List[blackbox.Context.Tree]
  3. val expected: Class[_]
  4. def fillInStackTrace(): java.lang.Throwable
    Definition Classes
    Throwable
  5. def getCause(): java.lang.Throwable
    Definition Classes
    Throwable
  6. def getLocalizedMessage(): String
    Definition Classes
    Throwable
  7. def getMessage(): String
    Definition Classes
    Throwable
  8. def getStackTrace(): Array[StackTraceElement]
    Definition Classes
    Throwable
  9. final def getSuppressed(): Array[java.lang.Throwable]
    Definition Classes
    Throwable
  10. def initCause(arg0: java.lang.Throwable): java.lang.Throwable
    Definition Classes
    Throwable
  11. def printStackTrace(arg0: PrintWriter): Unit
    Definition Classes
    Throwable
  12. def printStackTrace(arg0: PrintStream): Unit
    Definition Classes
    Throwable
  13. def printStackTrace(): Unit
    Definition Classes
    Throwable
  14. def productElementNames: Iterator[String]
    Definition Classes
    Product
  15. def setStackTrace(arg0: Array[StackTraceElement]): Unit
    Definition Classes
    Throwable
  16. def toString(): String
    Definition Classes
    Throwable → AnyRef → Any