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/t7020.scala | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/patmat/t7020.scala (limited to 'tests/patmat/t7020.scala') diff --git a/tests/patmat/t7020.scala b/tests/patmat/t7020.scala new file mode 100644 index 000000000..cc5421bab --- /dev/null +++ b/tests/patmat/t7020.scala @@ -0,0 +1,30 @@ +object Test { + // warning was non-deterministic + List(5) match { + case 1 :: Nil | 2 :: Nil => + case (x@(4 | 5 | 6)) :: Nil => + case 7 :: Nil => + case Nil => + } + + List(5) match { + case 1 :: Nil | 2 :: Nil => + case (x@(4 | 5 | 6)) :: Nil => + case 7 :: Nil => + case Nil => + } + + List(5) match { + case 1 :: Nil | 2 :: Nil => + case (x@(4 | 5 | 6)) :: Nil => + case 7 :: Nil => + case Nil => + } + + List(5) match { + case 1 :: Nil | 2 :: Nil => + case (x@(4 | 5 | 6)) :: Nil => + case 7 :: Nil => + case Nil => + } +} -- cgit v1.2.3