summaryrefslogtreecommitdiff
path: root/test/files/neg/t7157
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-06-03 11:08:50 -0700
committerEugene Burmako <xeno.by@gmail.com>2013-06-03 11:08:50 -0700
commit69887ddd682057c4787e2e4377830390faf8ecf1 (patch)
tree1158f24dd50dac397e867a6d2d861171e7335c4f /test/files/neg/t7157
parentc1cd65bb5276b715141df6d09fc95b0c44d2b4c2 (diff)
parent82f0925b69db8b5f9a3b10f58926c574433ca423 (diff)
downloadscala-69887ddd682057c4787e2e4377830390faf8ecf1.tar.gz
scala-69887ddd682057c4787e2e4377830390faf8ecf1.tar.bz2
scala-69887ddd682057c4787e2e4377830390faf8ecf1.zip
Merge pull request #2577 from scalamacros/pullrequest/paradise
Backport from paradise/macros
Diffstat (limited to 'test/files/neg/t7157')
-rw-r--r--test/files/neg/t7157/Impls_Macros_1.scala32
-rw-r--r--test/files/neg/t7157/Test_2.scala63
2 files changed, 95 insertions, 0 deletions
diff --git a/test/files/neg/t7157/Impls_Macros_1.scala b/test/files/neg/t7157/Impls_Macros_1.scala
new file mode 100644
index 0000000000..09f423fbab
--- /dev/null
+++ b/test/files/neg/t7157/Impls_Macros_1.scala
@@ -0,0 +1,32 @@
+import scala.reflect.macros.Context
+import language.experimental.macros
+
+object Macros {
+ def impl1_0_0(c: Context)() = c.literalUnit
+ def impl1_1_1(c: Context)(x: c.Expr[Int]) = c.literalUnit
+ def impl1_2_2(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = c.literalUnit
+ def m1_0_0() = macro impl1_0_0
+ def m1_1_1(x: Int) = macro impl1_1_1
+ def m1_2_2(x: Int, y: Int) = macro impl1_2_2
+
+ def impl1_0_inf(c: Context)(x: c.Expr[Int]*) = c.literalUnit
+ def impl1_1_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int]*) = c.literalUnit
+ def impl1_2_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = c.literalUnit
+ def m1_0_inf(x: Int*) = macro impl1_0_inf
+ def m1_1_inf(x: Int, y: Int*) = macro impl1_1_inf
+ def m1_2_inf(x: Int, y: Int, z: Int*) = macro impl1_2_inf
+
+ def impl2_0_0(c: Context)()() = c.literalUnit
+ def impl2_1_1(c: Context)()(x: c.Expr[Int]) = c.literalUnit
+ def impl2_2_2(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]) = c.literalUnit
+ def m2_0_0()() = macro impl2_0_0
+ def m2_1_1()(x: Int) = macro impl2_1_1
+ def m2_2_2()(x: Int, y: Int) = macro impl2_2_2
+
+ def impl2_0_inf(c: Context)()(x: c.Expr[Int]*) = c.literalUnit
+ def impl2_1_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]*) = c.literalUnit
+ def impl2_2_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = c.literalUnit
+ def m2_0_inf()(x: Int*) = macro impl2_0_inf
+ def m2_1_inf()(x: Int, y: Int*) = macro impl2_1_inf
+ def m2_2_inf()(x: Int, y: Int, z: Int*) = macro impl2_2_inf
+} \ No newline at end of file
diff --git a/test/files/neg/t7157/Test_2.scala b/test/files/neg/t7157/Test_2.scala
new file mode 100644
index 0000000000..45a6026399
--- /dev/null
+++ b/test/files/neg/t7157/Test_2.scala
@@ -0,0 +1,63 @@
+import Macros._
+
+object Test extends App {
+ m1_0_0()
+ m1_0_0(1)
+ m1_0_0(1, 2)
+ m1_0_0(1, 2, 3)
+
+ m1_1_1()
+ m1_1_1(1)
+ m1_1_1(1, 2)
+ m1_1_1(1, 2, 3)
+
+ m1_2_2()
+ m1_2_2(1)
+ m1_2_2(1, 2)
+ m1_2_2(1, 2, 3)
+
+ m1_0_inf()
+ m1_0_inf(1)
+ m1_0_inf(1, 2)
+ m1_0_inf(1, 2, 3)
+
+ m1_1_inf()
+ m1_1_inf(1)
+ m1_1_inf(1, 2)
+ m1_1_inf(1, 2, 3)
+
+ m1_2_inf()
+ m1_2_inf(1)
+ m1_2_inf(1, 2)
+ m1_2_inf(1, 2, 3)
+
+ m2_0_0()()
+ m2_0_0()(1)
+ m2_0_0()(1, 2)
+ m2_0_0()(1, 2, 3)
+
+ m2_1_1()()
+ m2_1_1()(1)
+ m2_1_1()(1, 2)
+ m2_1_1()(1, 2, 3)
+
+ m2_2_2()()
+ m2_2_2()(1)
+ m2_2_2()(1, 2)
+ m2_2_2()(1, 2, 3)
+
+ m2_0_inf()()
+ m2_0_inf()(1)
+ m2_0_inf()(1, 2)
+ m2_0_inf()(1, 2, 3)
+
+ m2_1_inf()()
+ m2_1_inf()(1)
+ m2_1_inf()(1, 2)
+ m2_1_inf()(1, 2, 3)
+
+ m2_2_inf()()
+ m2_2_inf()(1)
+ m2_2_inf()(1, 2)
+ m2_2_inf()(1, 2, 3)
+} \ No newline at end of file