summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-08-12 09:03:30 +0000
committerMartin Odersky <odersky@gmail.com>2010-08-12 09:03:30 +0000
commitb781e25afea36e2839d207125d3b91b35571d8ec (patch)
tree666181f980cbd9f0352e78e1d9baddd8cd4b0619 /test
parente3743b812ab05f15db8a8e64e47f8b92948fe180 (diff)
downloadscala-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')
-rw-r--r--test/files/neg/override.check5
-rwxr-xr-xtest/files/neg/override.scala15
-rw-r--r--test/files/pos/t3688.scala9
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]]
+
+}