summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-11-17 17:57:13 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-11-21 22:12:07 +1000
commitdde82ae61685698e66cb260ed1d66a0ba1b3c2da (patch)
tree6475a0ccc4fd5c8aa271c76bc0c6140f15d019dc /test
parent73678d4dafe250f0b38df2e953787af26b1a4ee3 (diff)
downloadscala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.tar.gz
scala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.tar.bz2
scala-dde82ae61685698e66cb260ed1d66a0ba1b3c2da.zip
Fix more compiler crashes with fields, refinement types
In the same manner as scala/scala-dev#219, the placement of the fields phase after uncurry is presenting some challenges in keeping our trees type correct. This commit whacks a few more moles by adding a casts in the body of synthetic methods. Fixes scala/scala-dev#268
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/sd268.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/pos/sd268.scala b/test/files/pos/sd268.scala
new file mode 100644
index 0000000000..8839651501
--- /dev/null
+++ b/test/files/pos/sd268.scala
@@ -0,0 +1,17 @@
+class Context(val v : AnyRef)
+
+trait AbidePlugin {
+ val someVal = ""
+
+ val x = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ lazy val y = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ var z = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+}
+
+class C {
+ val someVal = ""
+
+ val x = null.asInstanceOf[Context { val v : someVal.type }]
+ lazy val y = null.asInstanceOf[Context { val v : someVal.type }] // CRASH
+ var z = null.asInstanceOf[Context { val v : someVal.type }]
+}