From cc02243fbe8b7290265e1bdf540e4c2f256df199 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Thu, 21 Jul 2016 10:45:14 +0200 Subject: add test set for exhaustivity and redundancy check --- tests/patmat/virtpatmat_reach_sealed_unsealed.check | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/patmat/virtpatmat_reach_sealed_unsealed.check (limited to 'tests/patmat/virtpatmat_reach_sealed_unsealed.check') diff --git a/tests/patmat/virtpatmat_reach_sealed_unsealed.check b/tests/patmat/virtpatmat_reach_sealed_unsealed.check new file mode 100644 index 000000000..ef5ec1a00 --- /dev/null +++ b/tests/patmat/virtpatmat_reach_sealed_unsealed.check @@ -0,0 +1,11 @@ +./tests/patmat/virtpatmat_reach_sealed_unsealed.scala:16: warning: match may not be exhaustive. +It would fail on the following input: false + (true: Boolean) match { case true => } // not exhaustive, but reachable + ^ +./tests/patmat/virtpatmat_reach_sealed_unsealed.scala:18: warning: unreachable code + (true: Boolean) match { case true => case false => case _ => } // exhaustive, last case is unreachable + ^ +./tests/patmat/virtpatmat_reach_sealed_unsealed.scala:19: warning: unreachable code + (true: Boolean) match { case true => case false => case _: Boolean => } // exhaustive, last case is unreachable + ^ +three warnings found -- cgit v1.2.3