blob: 5d482333f528053fc3af1fbbea3621d0f5f889e2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import language.experimental.macros
class Test
object Test {
def foo: Unit = macro fooImpl
def fooImpl(c: reflect.macros.BlackboxContext) = { import c.universe._; c.Expr[Unit](q"()") }
def main(args: Array[String]) {
try {
val method = classOf[Test].getMethod("foo")
sys.error("Static forwarder generated for macro: " + method)
} catch {
case _: NoSuchMethodException => // okay
}
}
}
|