diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-09 09:54:05 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-09 09:54:05 -0700 |
commit | a05597e75fd9a88028a01828a59a59d037604c23 (patch) | |
tree | 9f2a040e14dfaab3846f6aa2957c92ebbe88a712 /test/files/neg | |
parent | 556c4204ad8ee6f67b29b5f91ace0229bcd16230 (diff) | |
parent | 97c338353dc0e83d93498ec486afbcff2aa9e931 (diff) | |
download | scala-a05597e75fd9a88028a01828a59a59d037604c23.tar.gz scala-a05597e75fd9a88028a01828a59a59d037604c23.tar.bz2 scala-a05597e75fd9a88028a01828a59a59d037604c23.zip |
Merge pull request #695 from adriaanm/topic-virtpatmat
better unreachability for selections
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 + } +} |