summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-01-14 17:29:42 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-05-28 08:23:44 +0200
commite1d9805c91dbe74317e2f4f22ad59056d64d12b3 (patch)
treecf8c3f135adfdcbfa090c3c408b7bce407c3cdeb /test/files/run
parent43249001a566c46d6bb3b515045ab477b42a0c77 (diff)
downloadscala-e1d9805c91dbe74317e2f4f22ad59056d64d12b3.tar.gz
scala-e1d9805c91dbe74317e2f4f22ad59056d64d12b3.tar.bz2
scala-e1d9805c91dbe74317e2f4f22ad59056d64d12b3.zip
macro engine refactoring
Macro impl bindings now store more information in signatures. Previously it was a flattened List[Int] corresponding to flattened paramss, now it's List[List[Int]] to preserve the lengths of parameter lists. Also now we distinguish between c.Expr parameters and others. Previously actual and reference macro signatures were represented as tuples of vparamss, rets, and sometimes tparams. Now they are all abstracted behind MacroImplSig. Finally this patch provides better error messages in cases of argsc <-> paramsc and argc <-> paramc mismatches.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/macro-invalidusage-partialapplication-with-tparams.check2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication.check2
-rw-r--r--test/files/run/reify-repl-fail-gracefully.check2
-rw-r--r--test/files/run/t7157.check1
-rw-r--r--test/files/run/t7157/Impls_Macros_1.scala15
-rw-r--r--test/files/run/t7157/Test_2.scala5
6 files changed, 24 insertions, 3 deletions
diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check
index f1d5e925fa..326f3e08ca 100644
--- a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check
+++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check
@@ -1,3 +1,3 @@
reflective compilation has failed:
-macros cannot be partially applied
+too few argument lists for macro invocation
diff --git a/test/files/run/macro-invalidusage-partialapplication.check b/test/files/run/macro-invalidusage-partialapplication.check
index f1d5e925fa..326f3e08ca 100644
--- a/test/files/run/macro-invalidusage-partialapplication.check
+++ b/test/files/run/macro-invalidusage-partialapplication.check
@@ -1,3 +1,3 @@
reflective compilation has failed:
-macros cannot be partially applied
+too few argument lists for macro invocation
diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check
index 1b0f3f2162..18cfd5a7ef 100644
--- a/test/files/run/reify-repl-fail-gracefully.check
+++ b/test/files/run/reify-repl-fail-gracefully.check
@@ -12,7 +12,7 @@ import scala.reflect.runtime.universe._
scala>
scala> reify
-<console>:12: error: macros cannot be partially applied
+<console>:12: error: too few argument lists for macro invocation
reify
^
diff --git a/test/files/run/t7157.check b/test/files/run/t7157.check
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/test/files/run/t7157.check
@@ -0,0 +1 @@
+1
diff --git a/test/files/run/t7157/Impls_Macros_1.scala b/test/files/run/t7157/Impls_Macros_1.scala
new file mode 100644
index 0000000000..ad3d96eb85
--- /dev/null
+++ b/test/files/run/t7157/Impls_Macros_1.scala
@@ -0,0 +1,15 @@
+import scala.reflect.macros.Context
+import language.experimental.macros
+
+object Macros {
+ object AImpl {
+ def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = {
+ import ctx.universe._
+ ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1)))))
+ }
+ }
+
+ implicit class A(context: StringContext) {
+ def a(args: Any*): Unit = macro AImpl.a
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t7157/Test_2.scala b/test/files/run/t7157/Test_2.scala
new file mode 100644
index 0000000000..cceb5ca177
--- /dev/null
+++ b/test/files/run/t7157/Test_2.scala
@@ -0,0 +1,5 @@
+import Macros._
+
+object Test extends App {
+ a""
+} \ No newline at end of file