summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-recursive
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/macro-expand-recursive')
-rw-r--r--test/files/run/macro-expand-recursive/Impls_1.scala15
-rw-r--r--test/files/run/macro-expand-recursive/Macros_Test_2.scala8
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/macro-expand-recursive/Impls_1.scala b/test/files/run/macro-expand-recursive/Impls_1.scala
new file mode 100644
index 0000000000..6eff805989
--- /dev/null
+++ b/test/files/run/macro-expand-recursive/Impls_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
+ Expr[Unit](body)
+ }
+
+ def fooFoo(c: Ctx) = {
+ import c.mirror._
+ val body = Select(Ident(newTermName("Macros")), newTermName("foo"))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-recursive/Macros_Test_2.scala b/test/files/run/macro-expand-recursive/Macros_Test_2.scala
new file mode 100644
index 0000000000..6ff691bdb1
--- /dev/null
+++ b/test/files/run/macro-expand-recursive/Macros_Test_2.scala
@@ -0,0 +1,8 @@
+object Macros {
+ def foo = macro Impls.foo
+ def fooFoo = macro Impls.fooFoo
+}
+
+object Test extends App {
+ Macros.fooFoo
+} \ No newline at end of file