Skip to content

Commit 4aba0fe

Browse files
committed
SI-5440 Test case for exhaustiveness check
Reported against patmatclassic, working in virtpatmat.
1 parent 9ea0a20 commit 4aba0fe

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

test/files/neg/t5440.check

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
t5440.scala:3: error: match may not be exhaustive.
2+
It would fail on the following inputs: (List(_), Nil), (Nil, List(_))
3+
(list1, list2) match {
4+
^
5+
one error found

test/files/neg/t5440.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xfatal-warnings

test/files/neg/t5440.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object Test {
2+
def merge(list1: List[Long], list2: List[Long]): Boolean =
3+
(list1, list2) match {
4+
case (hd1::_, hd2::_) => true
5+
case (Nil, Nil) => true
6+
}
7+
}

0 commit comments

Comments
 (0)