blob: 738c88bbc8f87666b4572053bd08eb208bd30e49 (
plain) (
tree)
|
|
import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo(unconventionalName: Ctx)(x: unconventionalName.Expr[Int]) = {
import unconventionalName.universe._
val body = Block(List(
Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo..."))))),
Literal(Constant(())))
unconventionalName.Expr[Unit](body)
}
}
object Macros {
def foo(x: Int) = macro Impls.foo
}
|