aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1050a.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/i1050a.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/i1050a.scala')
-rw-r--r--tests/neg/i1050a.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/neg/i1050a.scala b/tests/neg/i1050a.scala
index 47e2f0c59..4fea5e3b1 100644
--- a/tests/neg/i1050a.scala
+++ b/tests/neg/i1050a.scala
@@ -1,12 +1,13 @@
+// i1050 checks failing at refchecks
object Tiark1 {
trait A { type L <: Nothing }
trait B { type L >: Any}
trait U {
val p: B
- def brand(x: Any): p.L = x // error: not final
+ def brand(x: Any): p.L = x
}
trait V extends U {
- lazy val p: A & B = ???
+ lazy val p: A & B = ??? // error: may not override
}
val v = new V {}
v.brand("boom!")
@@ -17,11 +18,11 @@ object Tiark2 {
trait U {
type X <: B
val p: X
- def brand(x: Any): p.L = x // error: not final
+ def brand(x: Any): p.L = x
}
trait V extends U {
type X = B & A
- lazy val p: X = ???
+ lazy val p: X = ??? // error: may not override
}
val v = new V {}
v.brand("boom!"): Nothing