summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-implicit-macro-has-implicit
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/macro-expand-implicit-macro-has-implicit')
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala9
-rw-r--r--test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala5
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
new file mode 100644
index 0000000000..39db275e1c
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect.makro.{Context => Ctx}
+
+object Impls {
+ def foo(c: Ctx)(x: c.Expr[Int]) = {
+ import c.mirror._
+ val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(x.tree))
+ Expr[Unit](body)
+ }
+}
diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala
new file mode 100644
index 0000000000..ffb04dc80b
--- /dev/null
+++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ implicit val x = 42
+ def foo(implicit x: Int) = macro Impls.foo
+ foo
+} \ No newline at end of file