diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-15 10:30:30 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-15 10:30:30 +0200 |
commit | 894c9fbf247765041fc32788c78b85f1b2b2a191 (patch) | |
tree | aa918254e5b9869e10af3e967f980fd458e4c309 /tests/neg/t2994.scala | |
parent | a737b47a92fe414a5e7f07bae171878c81bf9f45 (diff) | |
download | dotty-894c9fbf247765041fc32788c78b85f1b2b2a191.tar.gz dotty-894c9fbf247765041fc32788c78b85f1b2b2a191.tar.bz2 dotty-894c9fbf247765041fc32788c78b85f1b2b2a191.zip |
Bounds of type lambdas compare contravariantly
Enable checking of bounds when comparing type lambdas. This invalidates
a pattern used in t2994 and potentially other code, where a bound [X] -> Any
is used as a template that is a legal supertype of all other bounds. The old
behavior is still available under language:Scala2.
Diffstat (limited to 'tests/neg/t2994.scala')
-rw-r--r-- | tests/neg/t2994.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/neg/t2994.scala b/tests/neg/t2994.scala index 6964a080e..e19397a3d 100644 --- a/tests/neg/t2994.scala +++ b/tests/neg/t2994.scala @@ -21,7 +21,7 @@ object Naturals { // crashes scala-2.8.0 beta1 trait MUL[n <: NAT, m <: NAT] extends NAT { trait curry[n[_[_], _], s[_]] { type f[z <: NAT] = n[s, z] } - type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z] // error: not a legal path // error: not a legal path + type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z] // error: not a legal path // error: not a legal path // error: arg does not conform to bound // error: arg does not conform to bound } } |