aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1050c.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-02 21:53:49 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:43:08 +0100
commitf6a5802b7185525f7e221b745ec283f8ea206161 (patch)
treeb518daeefae8dd8111ee8c17594a65b1df700e24 /tests/neg/i1050c.scala
parent187c241d7b2b3698a5773463c17fd26c8294d0f7 (diff)
downloaddotty-f6a5802b7185525f7e221b745ec283f8ea206161.tar.gz
dotty-f6a5802b7185525f7e221b745ec283f8ea206161.tar.bz2
dotty-f6a5802b7185525f7e221b745ec283f8ea206161.zip
By-name parameters are not stable values.
Diffstat (limited to 'tests/neg/i1050c.scala')
-rw-r--r--tests/neg/i1050c.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/neg/i1050c.scala b/tests/neg/i1050c.scala
index ece1f9986..7998d864d 100644
--- a/tests/neg/i1050c.scala
+++ b/tests/neg/i1050c.scala
@@ -29,3 +29,24 @@ object Tiark4 {
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 Tiark7 {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any }
+ def f(x: => B)(y: Any):x.L = y // error: x is not stable
+ def f1(x: => A & B)(y: Any):Nothing = f(x)(y) // error: type mismatch
+ f1(???)("boom!"): Nothing
+}