summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/neg/t2442.check5
-rw-r--r--test/files/neg/t2442.flags1
-rw-r--r--test/files/neg/t2442/MyEnum.java3
-rw-r--r--test/files/neg/t2442/t2442.scala9
4 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t2442.check b/test/files/neg/t2442.check
new file mode 100644
index 0000000000..b45ce3a2f5
--- /dev/null
+++ b/test/files/neg/t2442.check
@@ -0,0 +1,5 @@
+t2442.scala:4: error: match may not be exhaustive.
+It would fail on the following input: THREE
+ def f(e: MyEnum) = e match {
+ ^
+one error found
diff --git a/test/files/neg/t2442.flags b/test/files/neg/t2442.flags
new file mode 100644
index 0000000000..32cf036c3d
--- /dev/null
+++ b/test/files/neg/t2442.flags
@@ -0,0 +1 @@
+-Xexperimental -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t2442/MyEnum.java b/test/files/neg/t2442/MyEnum.java
new file mode 100644
index 0000000000..3ffbbb31b8
--- /dev/null
+++ b/test/files/neg/t2442/MyEnum.java
@@ -0,0 +1,3 @@
+public enum MyEnum {
+ ONE, TWO, THREE;
+} \ No newline at end of file
diff --git a/test/files/neg/t2442/t2442.scala b/test/files/neg/t2442/t2442.scala
new file mode 100644
index 0000000000..4ca0889400
--- /dev/null
+++ b/test/files/neg/t2442/t2442.scala
@@ -0,0 +1,9 @@
+class Test {
+ import MyEnum._
+
+ def f(e: MyEnum) = e match {
+ case ONE => println("one")
+ case TWO => println("two")
+ // missing case --> exhaustivity warning!
+ }
+} \ No newline at end of file