diff options
Diffstat (limited to 'test/files/run/macro-term-declared-in-object/Impls_1.scala')
-rw-r--r-- | test/files/run/macro-term-declared-in-object/Impls_1.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/macro-term-declared-in-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object/Impls_1.scala new file mode 100644 index 0000000000..348f3420f2 --- /dev/null +++ b/test/files/run/macro-term-declared-in-object/Impls_1.scala @@ -0,0 +1,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), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +}
\ No newline at end of file |