summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-16 16:17:03 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-02-16 16:17:03 +0100
commitd7332c0c6594fe2f7c2042410c1c8792c2a7658a (patch)
tree9a14d95704476f582e8fceb0230bb913f445beee /test/files
parentb0ac4da8a300f3a2c73423ec6f783d1bfb708843 (diff)
parent609047ba372ceaf06916d3361954bc949a6906ee (diff)
downloadscala-d7332c0c6594fe2f7c2042410c1c8792c2a7658a.tar.gz
scala-d7332c0c6594fe2f7c2042410c1c8792c2a7658a.tar.bz2
scala-d7332c0c6594fe2f7c2042410c1c8792c2a7658a.zip
Merge pull request #3513 from xeno-by/topic/typecheck-member-defs
typecheck(q"class C") no longer crashes
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/t7185.check4
-rw-r--r--test/files/run/typecheck.check0
-rw-r--r--test/files/run/typecheck/Macros_1.scala12
-rw-r--r--test/files/run/typecheck/Test_2.scala10
4 files changed, 23 insertions, 3 deletions
diff --git a/test/files/run/t7185.check b/test/files/run/t7185.check
index ebf85b731f..2b4adf36b4 100644
--- a/test/files/run/t7185.check
+++ b/test/files/run/t7185.check
@@ -24,9 +24,7 @@ tree: reflect.runtime.universe.Apply =
scala> {val tb = reflect.runtime.currentMirror.mkToolBox(); tb.typecheck(tree): Any}
res0: Any =
{
- {
- $read.O.apply()
- }
+ $read.O.apply()
}
scala>
diff --git a/test/files/run/typecheck.check b/test/files/run/typecheck.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/typecheck.check
diff --git a/test/files/run/typecheck/Macros_1.scala b/test/files/run/typecheck/Macros_1.scala
new file mode 100644
index 0000000000..ee1c8da763
--- /dev/null
+++ b/test/files/run/typecheck/Macros_1.scala
@@ -0,0 +1,12 @@
+import scala.reflect.macros.whitebox._
+import scala.language.experimental.macros
+
+object Macros {
+ def impl(c: Context) = {
+ import c.universe._
+ c.typecheck(q"class C")
+ q"()"
+ }
+
+ def foo: Any = macro impl
+} \ No newline at end of file
diff --git a/test/files/run/typecheck/Test_2.scala b/test/files/run/typecheck/Test_2.scala
new file mode 100644
index 0000000000..01bf5198cc
--- /dev/null
+++ b/test/files/run/typecheck/Test_2.scala
@@ -0,0 +1,10 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+object Test extends App {
+ Macros.foo
+
+ val tb = cm.mkToolBox()
+ tb.typecheck(q"class C")
+} \ No newline at end of file