diff options
author | Martin Odersky <odersky@gmail.com> | 2016-02-02 21:53:49 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-09 09:43:08 +0100 |
commit | f6a5802b7185525f7e221b745ec283f8ea206161 (patch) | |
tree | b518daeefae8dd8111ee8c17594a65b1df700e24 /tests/neg | |
parent | 187c241d7b2b3698a5773463c17fd26c8294d0f7 (diff) | |
download | dotty-f6a5802b7185525f7e221b745ec283f8ea206161.tar.gz dotty-f6a5802b7185525f7e221b745ec283f8ea206161.tar.bz2 dotty-f6a5802b7185525f7e221b745ec283f8ea206161.zip |
By-name parameters are not stable values.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/i1050.scala | 14 | ||||
-rw-r--r-- | tests/neg/i1050c.scala | 21 |
2 files changed, 21 insertions, 14 deletions
diff --git a/tests/neg/i1050.scala b/tests/neg/i1050.scala index fb4160606..1ade1366a 100644 --- a/tests/neg/i1050.scala +++ b/tests/neg/i1050.scala @@ -80,20 +80,6 @@ object Tiark3 { val v = new V {} v.brand("boom!"): Nothing } -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 } 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 +} |