blob: f6caf89dca0cf5f2dede76e946546d1ce9339863 (
plain) (
tree)
|
|
import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[Int]) = {
import c.mirror._
val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
Expr[Int](body)
}
}
object Macros {
def foo(x: Int) = macro Impls.foo
}
|