summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-07-24 21:07:54 -0700
committerSom Snytt <som.snytt@gmail.com>2013-07-27 05:24:20 -0700
commitb041fdc9cc372cfa9bed17f939747174b8b39542 (patch)
treea25ab4ea055168a48b9fab565c785f4fdc56d490 /test/files
parent56b7c0f8fa6c1037905867aec88520476dbd3baa (diff)
downloadscala-b041fdc9cc372cfa9bed17f939747174b8b39542.tar.gz
scala-b041fdc9cc372cfa9bed17f939747174b8b39542.tar.bz2
scala-b041fdc9cc372cfa9bed17f939747174b8b39542.zip
SI-7695 Macro debug output on -explaintypes
It looks like checkConforms should wait for error before using explainTypes, rather than turning on macro debug trace if explaintypes is set. In particular, macro debug output is Console.println instead of reporter.echo or similar, so partest can't test it.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t6123-explaintypes-macros.check9
-rw-r--r--test/files/neg/t6123-explaintypes-macros/BadMac_2.flags (renamed from test/files/pos/t6123-explaintypes-macros.flags)0
-rw-r--r--test/files/neg/t6123-explaintypes-macros/BadMac_2.scala8
-rw-r--r--test/files/neg/t6123-explaintypes-macros/Macros.flags1
-rw-r--r--test/files/neg/t6123-explaintypes-macros/Macros.scala (renamed from test/files/pos/t6123-explaintypes-macros.scala)3
5 files changed, 21 insertions, 0 deletions
diff --git a/test/files/neg/t6123-explaintypes-macros.check b/test/files/neg/t6123-explaintypes-macros.check
new file mode 100644
index 0000000000..ebcb8069d5
--- /dev/null
+++ b/test/files/neg/t6123-explaintypes-macros.check
@@ -0,0 +1,9 @@
+c.universe.Expr[Any]* <: c.universe.Expr[String]*?
+false
+BadMac_2.scala:6: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.macros.Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit]
+ found : (c: scala.reflect.macros.Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit]
+type mismatch for parameter params: c.Expr[Any]* does not conform to c.Expr[String]*
+ def printf(format: String, params: Any*): Unit = macro printf_impl
+ ^
+one error found
diff --git a/test/files/pos/t6123-explaintypes-macros.flags b/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags
index b36707c7cf..b36707c7cf 100644
--- a/test/files/pos/t6123-explaintypes-macros.flags
+++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags
diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
new file mode 100644
index 0000000000..38b8e24444
--- /dev/null
+++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala
@@ -0,0 +1,8 @@
+import scala.language.experimental.macros
+import scala.reflect.macros.Context
+
+// explain some macro types to me
+object BadMac {
+ def printf(format: String, params: Any*): Unit = macro printf_impl
+ def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] = ???
+}
diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.flags b/test/files/neg/t6123-explaintypes-macros/Macros.flags
new file mode 100644
index 0000000000..b36707c7cf
--- /dev/null
+++ b/test/files/neg/t6123-explaintypes-macros/Macros.flags
@@ -0,0 +1 @@
+-explaintypes
diff --git a/test/files/pos/t6123-explaintypes-macros.scala b/test/files/neg/t6123-explaintypes-macros/Macros.scala
index e650ad2038..a12c277c86 100644
--- a/test/files/pos/t6123-explaintypes-macros.scala
+++ b/test/files/neg/t6123-explaintypes-macros/Macros.scala
@@ -5,3 +5,6 @@ object Macros {
def printf(format: String, params: Any*): Unit = macro printf_impl
def printf_impl(c: Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] = ???
}
+
+// something trivial to run
+object Test extends App