diff options
author | Martin Odersky <odersky@gmail.com> | 2010-08-12 09:03:30 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-08-12 09:03:30 +0000 |
commit | b781e25afea36e2839d207125d3b91b35571d8ec (patch) | |
tree | 666181f980cbd9f0352e78e1d9baddd8cd4b0619 /test/files | |
parent | e3743b812ab05f15db8a8e64e47f8b92948fe180 (diff) | |
download | scala-b781e25afea36e2839d207125d3b91b35571d8ec.tar.gz scala-b781e25afea36e2839d207125d3b91b35571d8ec.tar.bz2 scala-b781e25afea36e2839d207125d3b91b35571d8ec.zip |
Fixed type soundness problem someone raised on ...
Fixed type soundness problem someone raised on hackers news. Test in
override.scala. Review by moors.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/override.check | 5 | ||||
-rwxr-xr-x | test/files/neg/override.scala | 15 | ||||
-rw-r--r-- | test/files/pos/t3688.scala | 9 |
3 files changed, 29 insertions, 0 deletions
diff --git a/test/files/neg/override.check b/test/files/neg/override.check new file mode 100644 index 0000000000..0336fb2b11 --- /dev/null +++ b/test/files/neg/override.check @@ -0,0 +1,5 @@ +override.scala:9: error: overriding type T in trait A with bounds >: Int <: Int; + type T in trait B with bounds >: String <: String has incompatible type + lazy val x : A with B = x + ^ +one error found diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala new file mode 100755 index 0000000000..764b06603a --- /dev/null +++ b/test/files/neg/override.scala @@ -0,0 +1,15 @@ +trait X { + trait A { type T >: Int <: Int } + val x : A + var n : x.T = 3 +} + +trait Y extends X { + trait B { type T >: String <: String } + lazy val x : A with B = x + n = "foo" +} + +object Test extends Application { + new Y {} +} diff --git a/test/files/pos/t3688.scala b/test/files/pos/t3688.scala new file mode 100644 index 0000000000..0ac1cfe514 --- /dev/null +++ b/test/files/pos/t3688.scala @@ -0,0 +1,9 @@ +import collection.mutable +import collection.JavaConversions._ +import java.{util => ju} + +object Test { + + implicitly[mutable.Map[Int, String] => ju.Dictionary[Int, String]] + +} |