summaryrefslogtreecommitdiff
path: root/test/files/run/macro-expand-default-named/Impls_1.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-16 16:45:27 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-02-16 16:45:27 +0100
commit6ef6c96eff2f0d2f505d45a1436d73a960193076 (patch)
tree6df5b2255fb4e369059fae1f3efbfdbe9c1506c6 /test/files/run/macro-expand-default-named/Impls_1.scala
parentd300fb6250dc0abdfb74194438bfc778446a9856 (diff)
parenta02e053a5dec134f7c7dc53a2c1091039218237d (diff)
downloadscala-6ef6c96eff2f0d2f505d45a1436d73a960193076.tar.gz
scala-6ef6c96eff2f0d2f505d45a1436d73a960193076.tar.bz2
scala-6ef6c96eff2f0d2f505d45a1436d73a960193076.zip
Merge pull request #3397 from xeno-by/ticket/5920
SI-5920 enables default and named args in macros
Diffstat (limited to 'test/files/run/macro-expand-default-named/Impls_1.scala')
-rw-r--r--test/files/run/macro-expand-default-named/Impls_1.scala37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/files/run/macro-expand-default-named/Impls_1.scala b/test/files/run/macro-expand-default-named/Impls_1.scala
new file mode 100644
index 0000000000..73774cd56a
--- /dev/null
+++ b/test/files/run/macro-expand-default-named/Impls_1.scala
@@ -0,0 +1,37 @@
+import scala.reflect.macros.blackbox.Context
+
+object Impls {
+ def one(c: Context)(x: c.Tree, y: c.Tree) = {
+ import c.universe._
+ val x1 = x orElse q"2"
+ val y1 = y orElse q"-40"
+ q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1))"
+ }
+
+ def onezero(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = {
+ import c.universe._
+ val x1 = x orElse q"2"
+ val y1 = y orElse q"-40"
+ val z1 = z
+ val w1 = w
+ q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))"
+ }
+
+ def zeroone(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = {
+ import c.universe._
+ val x1 = x
+ val y1 = y
+ val z1 = z orElse q"2"
+ val w1 = w orElse q"-40"
+ q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))"
+ }
+
+ def oneone(c: Context)(x: c.Tree, y: c.Tree)(z: c.Tree, w: c.Tree) = {
+ import c.universe._
+ val x1 = x orElse q"2"
+ val y1 = y orElse q"-40"
+ val z1 = z orElse q"2"
+ val w1 = w orElse q"-40"
+ q"println(${c.macroApplication.toString + " = "} + ($x1 - $y1 + $z1 - $w1))"
+ }
+} \ No newline at end of file