aboutsummaryrefslogtreecommitdiff
path: root/tests/patmat/exhausting.check
diff options
context:
space:
mode:
authorliu fengyun <liufengyunchina@gmail.com>2016-07-21 10:45:14 +0200
committerliu fengyun <liufengyunchina@gmail.com>2016-08-24 10:26:59 +0200
commitcc02243fbe8b7290265e1bdf540e4c2f256df199 (patch)
treebd83dcabb8de09fa48b9373b9431ef8c481da5ed /tests/patmat/exhausting.check
parent1a7618f32c6d8060c3a87ce633645440d500aa7a (diff)
downloaddotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.tar.gz
dotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.tar.bz2
dotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.zip
add test set for exhaustivity and redundancy check
Diffstat (limited to 'tests/patmat/exhausting.check')
-rw-r--r--tests/patmat/exhausting.check25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/patmat/exhausting.check b/tests/patmat/exhausting.check
new file mode 100644
index 000000000..790b12334
--- /dev/null
+++ b/tests/patmat/exhausting.check
@@ -0,0 +1,25 @@
+./tests/patmat/exhausting.scala:21: warning: match may not be exhaustive.
+It would fail on the following input: List(_), List(_, _, _)
+ def fail1[T](xs: List[T]) = xs match {
+ ^
+./tests/patmat/exhausting.scala:27: warning: match may not be exhaustive.
+It would fail on the following input: Nil
+ def fail2[T](xs: List[T]) = xs match {
+ ^
+./tests/patmat/exhausting.scala:32: warning: match may not be exhaustive.
+It would fail on the following input: List(_, _)
+ def fail3a(xs: List[Int]) = xs match {
+ ^
+./tests/patmat/exhausting.scala:39: warning: match may not be exhaustive.
+It would fail on the following input: Bar3
+ def fail3[T](x: Foo[T]) = x match {
+ ^
+./tests/patmat/exhausting.scala:44: warning: match may not be exhaustive.
+It would fail on the following input: (Bar2, Bar2)
+ def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
+ ^
+./tests/patmat/exhausting.scala:53: warning: match may not be exhaustive.
+It would fail on the following input: (Bar2, Bar2), (Bar2, Bar1), (Bar1, Bar3), (Bar1, Bar2)
+ def fail5[T](xx: (Foo[T], Foo[T])) = xx match {
+ ^
+6 warnings found