blob: 7dc58abba880da43e5075603bc07f73bfe951af0 (
plain) (
tree)
|
|
import scala.reflect.makro.{Context => Ctx}
object Impls {
def impl(c: Ctx) = {
import c.mirror._
val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
Expr[Unit](body)
}
def fooNullary(c: Ctx) = impl(c)
def fooEmpty(c: Ctx)() = impl(c)
def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)
def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)
}
|