summaryrefslogtreecommitdiff
path: root/test/files/run/t6662
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-13 13:39:46 -0800
committerEugene Burmako <xeno.by@gmail.com>2012-11-14 07:33:23 +0100
commitb9225732889448378ccb880faa6d8421cf40e02c (patch)
tree832414a2240b60de97db1bc2b1aa1ea02d95ab9a /test/files/run/t6662
parent1a6c8597109a9eee122d01c142d8955a14f704c8 (diff)
downloadscala-b9225732889448378ccb880faa6d8421cf40e02c.tar.gz
scala-b9225732889448378ccb880faa6d8421cf40e02c.tar.bz2
scala-b9225732889448378ccb880faa6d8421cf40e02c.zip
Fix for SI-6662, macro failing too early.
Don't give up before you try tupling. Who knows what someone might be doing with a Unit.
Diffstat (limited to 'test/files/run/t6662')
-rw-r--r--test/files/run/t6662/Macro_1.scala8
-rw-r--r--test/files/run/t6662/Test_2.scala8
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/t6662/Macro_1.scala b/test/files/run/t6662/Macro_1.scala
new file mode 100644
index 0000000000..f373eaaf94
--- /dev/null
+++ b/test/files/run/t6662/Macro_1.scala
@@ -0,0 +1,8 @@
+import language.experimental.macros
+import scala.reflect.macros.Context
+
+object Demo {
+ def id[T](a: T): T = macro idImpl[T]
+
+ def idImpl[T: c.WeakTypeTag](c: Context)(a: c.Expr[T]): c.Expr[T] = a
+}
diff --git a/test/files/run/t6662/Test_2.scala b/test/files/run/t6662/Test_2.scala
new file mode 100644
index 0000000000..03a80b655a
--- /dev/null
+++ b/test/files/run/t6662/Test_2.scala
@@ -0,0 +1,8 @@
+// Macro usage:
+
+object Test {
+ def main(args: Array[String]) {
+ val s = Demo id ()
+ println(s)
+ }
+}