diff options
Diffstat (limited to 'test/files/run/t7157')
-rw-r--r-- | test/files/run/t7157/Impls_Macros_1.scala | 15 | ||||
-rw-r--r-- | test/files/run/t7157/Test_2.scala | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t7157/Impls_Macros_1.scala b/test/files/run/t7157/Impls_Macros_1.scala new file mode 100644 index 0000000000..ad3d96eb85 --- /dev/null +++ b/test/files/run/t7157/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +object Macros { + object AImpl { + def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = { + import ctx.universe._ + ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1))))) + } + } + + implicit class A(context: StringContext) { + def a(args: Any*): Unit = macro AImpl.a + } +}
\ No newline at end of file diff --git a/test/files/run/t7157/Test_2.scala b/test/files/run/t7157/Test_2.scala new file mode 100644 index 0000000000..cceb5ca177 --- /dev/null +++ b/test/files/run/t7157/Test_2.scala @@ -0,0 +1,5 @@ +import Macros._ + +object Test extends App { + a"" +}
\ No newline at end of file |