summaryrefslogtreecommitdiff
path: root/test/pending/run/macro-expand-named
diff options
context:
space:
mode:
Diffstat (limited to 'test/pending/run/macro-expand-named')
-rw-r--r--test/pending/run/macro-expand-named/Impls_1.scala10
-rw-r--r--test/pending/run/macro-expand-named/Macros_Test_2.scala5
2 files changed, 15 insertions, 0 deletions
diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala
new file mode 100644
index 0000000000..fd5d8d7f18
--- /dev/null
+++ b/test/pending/run/macro-expand-named/Impls_1.scala
@@ -0,0 +1,10 @@
+import scala.reflect.macros.blackbox.Context
+
+object Impls {
+ def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = {
+ import c.universe._
+ val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree))
+ val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
+ Expr[Unit](body)
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/macro-expand-named/Macros_Test_2.scala b/test/pending/run/macro-expand-named/Macros_Test_2.scala
new file mode 100644
index 0000000000..abebcf8448
--- /dev/null
+++ b/test/pending/run/macro-expand-named/Macros_Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ def foo(x: Int, y: Int) = macro Impls.foo
+ foo(y = -40, x = 2)
+ foo(x = 2, y = -40)
+} \ No newline at end of file