aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1050c.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-02 10:21:12 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:43:08 +0100
commitec4a3a0f4d0b8cccf636d1608896e7cafba9dec0 (patch)
tree9b732c1937b3d781b117a445a95c7f5e6ffb8bbf /tests/neg/i1050c.scala
parentd34256c14a507dbdaea10bd83e8006cdafb9c799 (diff)
downloaddotty-ec4a3a0f4d0b8cccf636d1608896e7cafba9dec0.tar.gz
dotty-ec4a3a0f4d0b8cccf636d1608896e7cafba9dec0.tar.bz2
dotty-ec4a3a0f4d0b8cccf636d1608896e7cafba9dec0.zip
Big realizability refactoring
Move logic from TypeOps to new file CheckRealizable.scala. Also check realizable fields under strict mode. Check at phase PostTyper rather than Typer to avoid cycles. New tests for imports and deep paths.
Diffstat (limited to 'tests/neg/i1050c.scala')
-rw-r--r--tests/neg/i1050c.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/neg/i1050c.scala b/tests/neg/i1050c.scala
new file mode 100644
index 000000000..ece1f9986
--- /dev/null
+++ b/tests/neg/i1050c.scala
@@ -0,0 +1,31 @@
+// i1050 checks failing at typer
+object Import {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any}
+ trait U {
+ lazy val p: B
+ locally { val x: p.L = ??? } // error: nonfinal lazy
+ locally {
+ import p._
+ val x: L = ??? // error: nonfinal lazy
+ }
+ }
+}
+object Tiark4 {
+ trait U {
+ type Y
+ trait X { type L = Y }
+ def compute: X
+ final lazy val p: X = compute
+ def brand(x: Y): p.L = x
+ }
+ trait V extends U {
+ type Y >: Any <: Nothing
+ def compute: X = ???
+ }
+ val v = new V {} // error: cannot be instantiated
+ v.brand("boom!")
+}
+object V { // error: cannot be instantiated
+ type Y >: Any <: Nothing // error: only classes can have declared but undefined members
+}