blob: 4fddc13d68e756ab5bdf0621b42e60f45e4a280d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
c.Expr[Unit](body)
}
}
|