diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-27 06:41:17 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-27 09:24:04 -0700 |
commit | 96d4a8646b1962fac2f2fc443b56c6619221b43c (patch) | |
tree | bd39f411275452bb5db2335da966ac8042cd504f /test/files/neg/unchecked2.check | |
parent | 17b409b7832f541e3d52d2776c8ff3c47574ae0f (diff) | |
download | scala-96d4a8646b1962fac2f2fc443b56c6619221b43c.tar.gz scala-96d4a8646b1962fac2f2fc443b56c6619221b43c.tar.bz2 scala-96d4a8646b1962fac2f2fc443b56c6619221b43c.zip |
Nailed down the "impossible match" logic.
I will again defer to a comment.
/** Given classes A and B, can it be shown that nothing which is
* an A will ever be a subclass of something which is a B? This
* entails not only showing that !(A isSubClass B) but that the
* same is true of all their subclasses. Restated for symmetry:
* the same value cannot be a member of both A and B.
*
* 1) A must not be a subclass of B, nor B of A (the trivial check)
* 2) One of A or B must be completely knowable (see isKnowable)
* 3) Assuming A is knowable, the proposition is true if
* !(A' isSubClass B) for all A', where A' is a subclass of A.
*
* Due to symmetry, the last condition applies as well in reverse.
*/
Diffstat (limited to 'test/files/neg/unchecked2.check')
-rw-r--r-- | test/files/neg/unchecked2.check | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/files/neg/unchecked2.check b/test/files/neg/unchecked2.check index b4a14358c7..68fdfa82ac 100644 --- a/test/files/neg/unchecked2.check +++ b/test/files/neg/unchecked2.check @@ -1,22 +1,22 @@ -unchecked2.scala:4: error: fruitless type test: a Some[List[Int]] can never be a Option[List[String]] (but still might match its erasure) +unchecked2.scala:4: error: fruitless type test: a value of type Some[List[Int]] cannot also be a Option[List[String]] (but still might match its erasure) /* warn */ Some(List(1)).isInstanceOf[Option[List[String]]] ^ unchecked2.scala:5: error: non-variable type argument Option[_] in type Option[Option[_]] is unchecked since it is eliminated by erasure /* warn */ Some(123).isInstanceOf[Option[Option[_]]] ^ -unchecked2.scala:6: error: fruitless type test: a Some[Int] can never be a Option[String] (but still might match its erasure) +unchecked2.scala:6: error: fruitless type test: a value of type Some[Int] cannot also be a Option[String] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[String]] ^ -unchecked2.scala:7: error: fruitless type test: a Some[Int] can never be a Option[List[String]] (but still might match its erasure) +unchecked2.scala:7: error: fruitless type test: a value of type Some[Int] cannot also be a Option[List[String]] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[List[String]]] ^ -unchecked2.scala:8: error: fruitless type test: a Some[Int] can never be a Option[List[Int => String]] (but still might match its erasure) +unchecked2.scala:8: error: fruitless type test: a value of type Some[Int] cannot also be a Option[List[Int => String]] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[List[Int => String]]] ^ -unchecked2.scala:9: error: fruitless type test: a Some[Int] can never be a Option[(String, Double)] (but still might match its erasure) +unchecked2.scala:9: error: fruitless type test: a value of type Some[Int] cannot also be a Option[(String, Double)] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[(String, Double)]] ^ -unchecked2.scala:10: error: fruitless type test: a Some[Int] can never be a Option[String => Double] (but still might match its erasure) +unchecked2.scala:10: error: fruitless type test: a value of type Some[Int] cannot also be a Option[String => Double] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[String => Double]] ^ unchecked2.scala:14: error: non-variable type argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure |