Skip to content

Commit e2db834

Browse files
committed
add test t5440 for patmat check
1 parent b25e952 commit e2db834

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tests/patmat/t5440.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
./tests/patmat/t5440.scala:3: warning: match may not be exhaustive.
2-
It would fail on the following input: { (Nil, List(_)), (List(_), Nil) }
3-
(list1, list2) match {
4-
^
1+
./tests/patmat/t5440.scala:2: warning: match may not be exhaustive.
2+
It would fail on the following input: (Nil, List(_)), (List(_), Nil)
3+
def merge(list1: List[Long], list2: List[Long]): Boolean = (list1, list2) match {
4+
^
55
one warning found

tests/patmat/t5440.scala

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

0 commit comments

Comments
 (0)