diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.check | 4 | ||||
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.flags | 1 | ||||
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.scala | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/virtpatmat_unreach_select.check b/test/files/neg/virtpatmat_unreach_select.check new file mode 100644 index 0000000000..3771971020 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.check @@ -0,0 +1,4 @@ +virtpatmat_unreach_select.scala:10: error: unreachable code + case WARNING.id => // unreachable + ^ +one error found diff --git a/test/files/neg/virtpatmat_unreach_select.flags b/test/files/neg/virtpatmat_unreach_select.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/neg/virtpatmat_unreach_select.scala b/test/files/neg/virtpatmat_unreach_select.scala new file mode 100644 index 0000000000..c46ff15453 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.scala @@ -0,0 +1,12 @@ +class Test { + object severity extends Enumeration + class Severity(val id: Int) extends severity.Value + val INFO = new Severity(0) + val WARNING = new Severity(1) + + (0: Int) match { + case WARNING.id => + case INFO.id => // reachable + case WARNING.id => // unreachable + } +} |