blob: 5b04cf29e97b061e9b6e361e8adc0ec00d998860 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import scala.reflect.macros.blackbox.Context
object Macros {
def impl(c: Context) = {
import c.universe._
reify {
println("enclosingPackage = " + c.Expr[String](Literal(Constant(c.enclosingPackage.toString))).splice)
println("enclosingClass = " + c.Expr[String](Literal(Constant(c.enclosingClass.toString))).splice)
println("enclosingImpl = " + c.Expr[String](Literal(Constant(c.enclosingImpl.toString))).splice)
println("enclosingTemplate = " + c.Expr[String](Literal(Constant(c.enclosingTemplate.toString))).splice)
println("enclosingMethod = " + c.Expr[String](Literal(Constant(c.enclosingMethod.toString))).splice)
println("enclosingDef = " + c.Expr[String](Literal(Constant(c.enclosingDef.toString))).splice)
}
}
def foo = macro impl
}
|