summaryrefslogtreecommitdiff
path: root/test/files/neg/exhausting.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-05 15:34:37 +0000
committerPaul Phillips <paulp@improving.org>2010-10-05 15:34:37 +0000
commit7553e6901d52ace00bfcb670336c480766c8301c (patch)
tree720e9fa758661c6d5cc51340b4b693433d00d696 /test/files/neg/exhausting.scala
parenta4cf7b1ec5dade69b41e59469b9b3f65415b9822 (diff)
downloadscala-7553e6901d52ace00bfcb670336c480766c8301c.tar.gz
scala-7553e6901d52ace00bfcb670336c480766c8301c.tar.bz2
scala-7553e6901d52ace00bfcb670336c480766c8301c.zip
Improves exhaustiveness analysis to not warn ab...
Improves exhaustiveness analysis to not warn about types which cannot match due to nonconformant type parameters. Also, look at the different warnings emitted in the test case based on the presence of a constraint. Nifty! Closes #3683, no review.
Diffstat (limited to 'test/files/neg/exhausting.scala')
-rw-r--r--test/files/neg/exhausting.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/files/neg/exhausting.scala b/test/files/neg/exhausting.scala
index 8b1ea817e4..0741d7467b 100644
--- a/test/files/neg/exhausting.scala
+++ b/test/files/neg/exhausting.scala
@@ -28,7 +28,12 @@ object Test {
case Bar1 => "ok"
case Bar2 => "ok"
}
- def fail4[T](xx: (Foo[T], Foo[T])) = xx match {
+ def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
+ case (Bar1, Bar1) => ()
+ case (Bar2, Bar3) => ()
+ case (Bar3, _) => ()
+ }
+ def fail5[T](xx: (Foo[T], Foo[T])) = xx match {
case (Bar1, Bar1) => ()
case (Bar2, Bar3) => ()
case (Bar3, _) => ()