aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-01 13:03:15 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:43:07 +0100
commitd34256c14a507dbdaea10bd83e8006cdafb9c799 (patch)
tree4cea7ab1c0346ec18a40ee32f44bd5c959a91f27 /tests/neg
parent20fc6bd93c543f98da39a165437234670505f860 (diff)
downloaddotty-d34256c14a507dbdaea10bd83e8006cdafb9c799.tar.gz
dotty-d34256c14a507dbdaea10bd83e8006cdafb9c799.tar.bz2
dotty-d34256c14a507dbdaea10bd83e8006cdafb9c799.zip
Handle paths of length > 1 for realizability checking
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i1050.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/neg/i1050.scala b/tests/neg/i1050.scala
index 5808011fa..f2c237af2 100644
--- a/tests/neg/i1050.scala
+++ b/tests/neg/i1050.scala
@@ -109,3 +109,30 @@ object Import {
object V { // error: cannot be instantiated
type Y >: Any <: Nothing // error: only classes can have declared but undefined members
}
+object Tiark5 {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any }
+ def f(x: => A & B)(y: Any):Nothing = (y:x.L) // error: underlying conflicting bounds
+ f(???)("boom!")
+}
+object Tiark5Inherited {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any }
+ trait A2 extends A
+ trait B2 extends B
+ def f(x: => A2 & B2)(y: Any):Nothing = (y:x.L) // error: underlying conflicting bounds
+ f(???)("boom!")
+}
+object Tiark6 {
+ trait B { type L >: Any }
+ trait A { type L <: Nothing }
+ trait U {
+ trait X {
+ val q: A & B = ???
+ }
+ final lazy val p: X = ???
+ def brand(x: Any): p.q.L = x // error: conflicting bounds
+ }
+ val v = new U {}
+ v.brand("boom!"): Nothing
+}