Skip to content

Commit

Permalink
SI-5440 Test case for exhaustiveness check
Browse files Browse the repository at this point in the history
Reported against patmatclassic, working in virtpatmat.
  • Loading branch information
retronym committed Jan 13, 2013
1 parent 9ea0a20 commit 4aba0fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/files/neg/t5440.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
t5440.scala:3: error: match may not be exhaustive.
It would fail on the following inputs: (List(_), Nil), (Nil, List(_))
(list1, list2) match {
^
one error found
1 change: 1 addition & 0 deletions test/files/neg/t5440.flags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Xfatal-warnings
7 changes: 7 additions & 0 deletions test/files/neg/t5440.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
object Test {
def merge(list1: List[Long], list2: List[Long]): Boolean =
(list1, list2) match {
case (hd1::_, hd2::_) => true
case (Nil, Nil) => true
}
}

0 comments on commit 4aba0fe

Please sign in to comment.