Type of the wrapped expression tree as found in the underlying tree.
Migrates the expression into another mirror, jumping into a different universe if necessary.
Underlying mirror of this expr.
A dummy method to mark expression splicing in reification.
A dummy method to mark expression splicing in reification.
It should only be used within a reify
call, which eliminates the splice
call and embeds
the wrapped tree into the reified surrounding expression.
If used alone splice
throws an exception when called at runtime.
If you want to use an Expr in reification of some Scala code, you need to splice it in.
For an expr of type Expr[T]
, where T
has a method foo
, the following code
reify{ expr.splice.foo }
uses splice to turn an expr of type Expr[T] into a value of type T in the context of reify
.
It is equivalent to
Select( expr.tree, newTermName("foo") )
The following example code however does not compile
reify{ expr.foo }
because expr of type Expr[T] itself does not have a method foo.
Type of the wrapped expression tree as provided during creation.
Type of the wrapped expression tree as provided during creation.
When exprs are created by the compiler, staticType
represents
a statically known type of the tree as calculated at that point by the compiler.
The Scala abstract syntax tree representing the wrapped expression.
A dummy value to denote cross-stage path-dependent type dependencies.
A dummy value to denote cross-stage path-dependent type dependencies.
For example for the following macro definition:
class X { type T } object Macros { def foo(x: X): x.T = macro Impls.foo_impl }
The corresponding macro implementation should have the following signature (note how the return type denotes path-dependency on x):
object Impls { def foo_impl(c: BlackboxContext)(x: c.Expr[X]): c.Expr[x.value.T] = ... }
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.