summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5692a.check4
-rw-r--r--test/files/neg/t5692a.flags1
-rw-r--r--test/files/neg/t5692a/Macros_1.scala6
-rw-r--r--test/files/neg/t5692a/Test_2.scala3
-rw-r--r--test/files/neg/t5692b.check4
-rw-r--r--test/files/neg/t5692b.flags1
-rw-r--r--test/files/neg/t5692b/Macros_1.scala6
-rw-r--r--test/files/neg/t5692b/Test_2.scala3
-rw-r--r--test/files/run/t5942.check0
-rw-r--r--test/files/run/t5942.scala10
10 files changed, 38 insertions, 0 deletions
diff --git a/test/files/neg/t5692a.check b/test/files/neg/t5692a.check
new file mode 100644
index 0000000000..527cb35fba
--- /dev/null
+++ b/test/files/neg/t5692a.check
@@ -0,0 +1,4 @@
+Test_2.scala:2: error: type parameter not specified
+ def x = Macros.foo
+ ^
+one error found
diff --git a/test/files/neg/t5692a.flags b/test/files/neg/t5692a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/t5692a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/t5692a/Macros_1.scala b/test/files/neg/t5692a/Macros_1.scala
new file mode 100644
index 0000000000..06b5a3de36
--- /dev/null
+++ b/test/files/neg/t5692a/Macros_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.macros.Context
+
+object Macros {
+ def impl[T](c: Context) = c.literalUnit
+ def foo[T] = macro impl[T]
+} \ No newline at end of file
diff --git a/test/files/neg/t5692a/Test_2.scala b/test/files/neg/t5692a/Test_2.scala
new file mode 100644
index 0000000000..08d510cc6f
--- /dev/null
+++ b/test/files/neg/t5692a/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def x = Macros.foo
+} \ No newline at end of file
diff --git a/test/files/neg/t5692b.check b/test/files/neg/t5692b.check
new file mode 100644
index 0000000000..8f6b2624cf
--- /dev/null
+++ b/test/files/neg/t5692b.check
@@ -0,0 +1,4 @@
+Test_2.scala:2: error: type parameters not specified
+ def x = Macros.foo
+ ^
+one error found
diff --git a/test/files/neg/t5692b.flags b/test/files/neg/t5692b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/t5692b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/t5692b/Macros_1.scala b/test/files/neg/t5692b/Macros_1.scala
new file mode 100644
index 0000000000..b28d19f903
--- /dev/null
+++ b/test/files/neg/t5692b/Macros_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.macros.Context
+
+object Macros {
+ def impl[T, U](c: Context) = c.literalUnit
+ def foo[T, U] = macro impl[T, U]
+} \ No newline at end of file
diff --git a/test/files/neg/t5692b/Test_2.scala b/test/files/neg/t5692b/Test_2.scala
new file mode 100644
index 0000000000..08d510cc6f
--- /dev/null
+++ b/test/files/neg/t5692b/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def x = Macros.foo
+} \ No newline at end of file
diff --git a/test/files/run/t5942.check b/test/files/run/t5942.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5942.check
diff --git a/test/files/run/t5942.scala b/test/files/run/t5942.scala
new file mode 100644
index 0000000000..44a8be93f6
--- /dev/null
+++ b/test/files/run/t5942.scala
@@ -0,0 +1,10 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect._
+
+object Test extends App {
+ val tb = cm.mkToolBox()
+ tb.parse("def x = {}")
+ try { tb.parse("def x = {") } catch { case _ => }
+ tb.parse("def x = {}")
+}