blob: 086f9aeef2ab79ace73c40b9a8c39fac8f227530 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[Int]) = {
val x1 = c.Expr[Int](c.resetAllAttrs(x.tree))
c.literal(x1.eval)
}
}
object Macros {
def foo(x: Int) = macro Impls.foo
}
|