From 2f4f3d3db7c2eb9ed535065ffed8098a99de0278 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Mon, 5 Feb 2007 17:17:17 +0000 Subject: exhaustivity reworked --- test/files/neg/patmatexhaust.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/files/neg/patmatexhaust.scala') diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index aaa32cda24..7370868363 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -27,7 +27,6 @@ class TestSealedExhaustive { // compile only //case {Qult(), Qult()} => } - sealed class Deep case object Ga extends Deep @@ -42,11 +41,11 @@ class TestSealedExhaustive { // compile only case _ => } - def ma4(x:Deep) = x match { // missing cases: Gu + def ma4(x:Deep) = x match { // missing cases: Gu, Gp case Ga => } - def zma5(x:Deep) = x match { // exhaustive + def ma5(x:Deep) = x match { // Gp case Gu => case _ if 1 == 0 => case Ga => @@ -56,6 +55,11 @@ class TestSealedExhaustive { // compile only case List(1,2) => case x :: xs => } + + def ma7 = List(1,2) match { //exhaustive + case 1::2::Nil => + case _ => + } def redundant = 1 match { // include this otherwise script won't test this in files/neg case 1 => case 1 => -- cgit v1.2.3