diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t2442.check | 6 | ||||
-rw-r--r-- | test/files/neg/t2442/MySecondEnum.java | 6 | ||||
-rw-r--r-- | test/files/neg/t2442/t2442.scala | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/test/files/neg/t2442.check b/test/files/neg/t2442.check index b45ce3a2f5..714816fd62 100644 --- a/test/files/neg/t2442.check +++ b/test/files/neg/t2442.check @@ -2,4 +2,8 @@ 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 +t2442.scala:11: error: match may not be exhaustive. +It would fail on the following input: BLUE + def g(e: MySecondEnum) = e match { + ^ +two errors found diff --git a/test/files/neg/t2442/MySecondEnum.java b/test/files/neg/t2442/MySecondEnum.java new file mode 100644 index 0000000000..0f841286de --- /dev/null +++ b/test/files/neg/t2442/MySecondEnum.java @@ -0,0 +1,6 @@ +public enum MySecondEnum { + RED(1), BLUE(2) { public void foo() {} }; + MySecondEnum(int i) {} + + public void foo() {} +}
\ No newline at end of file diff --git a/test/files/neg/t2442/t2442.scala b/test/files/neg/t2442/t2442.scala index 4ca0889400..b0a0f3cd41 100644 --- a/test/files/neg/t2442/t2442.scala +++ b/test/files/neg/t2442/t2442.scala @@ -6,4 +6,10 @@ class Test { case TWO => println("two") // missing case --> exhaustivity warning! } + + import MySecondEnum._ + def g(e: MySecondEnum) = e match { + case RED => println("red") + // missing case --> exhaustivity warning! + } }
\ No newline at end of file |