summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-02 07:36:58 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-01-28 15:05:10 -0800
commitf6d90a8a2502c0e1f0ecf72a2fd4258c4f52ec84 (patch)
treee98828f2ddf4402f7637af3fde85c5fc5e9e5ddf /test/pending
parentcc3b9a23ebb453b827197e5ab5cba46a9e770f0c (diff)
downloadscala-f6d90a8a2502c0e1f0ecf72a2fd4258c4f52ec84.tar.gz
scala-f6d90a8a2502c0e1f0ecf72a2fd4258c4f52ec84.tar.bz2
scala-f6d90a8a2502c0e1f0ecf72a2fd4258c4f52ec84.zip
[backport] SI-5378, unsoundness with type bounds in refinements.
As the comment says: Not enough to look for abstract types; have to recursively check the bounds of each abstract type for more abstract types. Almost certainly there are other exploitable type soundness bugs which can be seen by bounding a type parameter by an abstract type which itself is bounded by an abstract type. SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE In refinement types, only the first parameter list of methods was being analyzed for unsound uses of abstract types. Second parameter list and beyond had free unsoundness reign. That bug as well is fixed here.
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/neg/t5378.scala19
1 files changed, 0 insertions, 19 deletions
diff --git a/test/pending/neg/t5378.scala b/test/pending/neg/t5378.scala
deleted file mode 100644
index cada29b0a0..0000000000
--- a/test/pending/neg/t5378.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-import language.reflectiveCalls
-
-class Coll[+T] {
- def contains = new { def apply[T1 <: T](value: T1) = ??? }
-}
-
-object Test {
- def main(args: Array[String]): Unit = {
- val xs = new Coll[List[String]]
- val ys: Coll[Traversable[String]] = xs
-
- println(ys contains Nil)
- // java.lang.NoSuchMethodException: Coll$$anon$1.apply(scala.collection.Traversable)
- // at java.lang.Class.getMethod(Class.java:1605)
- // at Test$.reflMethod$Method1(a.scala:14)
- // at Test$.main(a.scala:14)
- // at Test.main(a.scala)
- }
-}