blob: 1f8f3cbd5a9c3fadeaea4a2a231470403b2e23b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo(c: Ctx) = {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
}
|