summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-01-14 15:32:03 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-01-14 15:32:03 -0800
commit5197864839ce046336f1447a42f2bca1082abb5e (patch)
tree24e2417825fb547b9c418b4bf4630c1b55ef881d /test/files/neg
parent9dbcbf14080197046825d16300b20b068cd7b1a0 (diff)
parent4aba0fe2a2195176693509c735ffdedb52352720 (diff)
downloadscala-5197864839ce046336f1447a42f2bca1082abb5e.tar.gz
scala-5197864839ce046336f1447a42f2bca1082abb5e.tar.bz2
scala-5197864839ce046336f1447a42f2bca1082abb5e.zip
Merge pull request #1890 from retronym/ticket/5440
SI-5440 Test case for exhaustiveness check
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t5440.check5
-rw-r--r--test/files/neg/t5440.flags1
-rw-r--r--test/files/neg/t5440.scala7
3 files changed, 13 insertions, 0 deletions
diff --git a/test/files/neg/t5440.check b/test/files/neg/t5440.check
new file mode 100644
index 0000000000..a862350a05
--- /dev/null
+++ b/test/files/neg/t5440.check
@@ -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
diff --git a/test/files/neg/t5440.flags b/test/files/neg/t5440.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t5440.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t5440.scala b/test/files/neg/t5440.scala
new file mode 100644
index 0000000000..d9cf5d6252
--- /dev/null
+++ b/test/files/neg/t5440.scala
@@ -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
+ }
+} \ No newline at end of file