summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-03-11 22:53:09 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-11 22:53:09 -0700
commitbc5c177c6b910080f76fba85ffd9441a4a93173f (patch)
treecda9cfe031146e7ce9e6e02dfaf702f2f09ac420 /test
parent221f52757aa64d47fffe0a8e2204943423041316 (diff)
parent3ae265395c43711cabc5193fd3c8f95a9f86c843 (diff)
downloadscala-bc5c177c6b910080f76fba85ffd9441a4a93173f.tar.gz
scala-bc5c177c6b910080f76fba85ffd9441a4a93173f.tar.bz2
scala-bc5c177c6b910080f76fba85ffd9441a4a93173f.zip
Merge pull request #2223 from scalamacros/ticket/7235
reifier is now aware of SI-7235
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t7235.check4
-rw-r--r--test/files/neg/t7235.scala14
-rw-r--r--test/files/run/t7235.check4
-rw-r--r--test/files/run/t7235.scala14
4 files changed, 36 insertions, 0 deletions
diff --git a/test/files/neg/t7235.check b/test/files/neg/t7235.check
new file mode 100644
index 0000000000..357a3dfd83
--- /dev/null
+++ b/test/files/neg/t7235.check
@@ -0,0 +1,4 @@
+t7235.scala:9: error: implementation restriction: cannot reify refinement type trees with non-empty bodies
+ val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C { def x: Int } = ??? }.tree
+ ^
+one error found
diff --git a/test/files/neg/t7235.scala b/test/files/neg/t7235.scala
new file mode 100644
index 0000000000..cfebad3fae
--- /dev/null
+++ b/test/files/neg/t7235.scala
@@ -0,0 +1,14 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+class C
+
+object Test extends App {
+ val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C { def x: Int } = ??? }.tree
+ println(tpt)
+ println(tpt.templ.parents)
+ println(tpt.templ.self)
+ println(tpt.templ.body)
+}
diff --git a/test/files/run/t7235.check b/test/files/run/t7235.check
new file mode 100644
index 0000000000..9cb9c55a0c
--- /dev/null
+++ b/test/files/run/t7235.check
@@ -0,0 +1,4 @@
+C
+List(C)
+private val _ = _
+List()
diff --git a/test/files/run/t7235.scala b/test/files/run/t7235.scala
new file mode 100644
index 0000000000..6039189716
--- /dev/null
+++ b/test/files/run/t7235.scala
@@ -0,0 +1,14 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+class C
+
+object Test extends App {
+ val Block(List(ValDef(_, _, tpt: CompoundTypeTree, _)), _) = reify{ val x: C{} = ??? }.tree
+ println(tpt)
+ println(tpt.templ.parents)
+ println(tpt.templ.self)
+ println(tpt.templ.body)
+}