summaryrefslogtreecommitdiff
path: root/test/files/run/t6591_3.scala
diff options
context:
space:
mode:
authorDmitry Bushev <bushevdv@gmail.com>2012-12-14 17:09:55 +0400
committerEugene Burmako <xeno.by@gmail.com>2013-02-08 12:53:14 +0100
commit09ef8730d13eff1cf200bbfb0f6fda7f6d72524a (patch)
tree85c49426a77eb415678fdea5eee12522ca16e276 /test/files/run/t6591_3.scala
parent9164c2af4183e04986eb652e09081daba3d0d279 (diff)
downloadscala-09ef8730d13eff1cf200bbfb0f6fda7f6d72524a.tar.gz
scala-09ef8730d13eff1cf200bbfb0f6fda7f6d72524a.tar.bz2
scala-09ef8730d13eff1cf200bbfb0f6fda7f6d72524a.zip
SI-6591 Reify and path-dependent types
Reification scheme changed. Now Select an SelectFromTypeTree trees reified appropriately, as Select and SelectFromTypeTree accordingly. Packages and Predef object was excluded in order not to break the existing reification scheme and not to break tests which rely on it. Reified free terms can contain flag <stable> to make reified values become stable identifiers. For example in the case of reify_newimpl_15.scala class C { type T reify { val v: List[T] = List(2) } } class C reified as free term C$value, and List[C.T] becomes List[C$value().T], so C$value.apply() need to pass stability test isExprSafeToInline at scala.reflect.internal.TreeInfo. For this purpose special case for reified free terms was added to isExprSafeToInline function. test run/reify_newipl_30 disabled due to SI-7082 test t6591_4 moved to pending due to SI-7083
Diffstat (limited to 'test/files/run/t6591_3.scala')
-rw-r--r--test/files/run/t6591_3.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t6591_3.scala b/test/files/run/t6591_3.scala
new file mode 100644
index 0000000000..b73a7baf48
--- /dev/null
+++ b/test/files/run/t6591_3.scala
@@ -0,0 +1,17 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.ToolBox
+import scala.tools.reflect.Eval
+
+class O { class I }
+
+object A extends O {
+ val code = reify {
+ val v: I = new I
+ v
+ }
+ println(showRaw(code.tree))
+}
+
+object Test extends App {
+ val v: A.I = A.code.eval
+}