summaryrefslogtreecommitdiff
path: root/test/files/neg/virtpatmat_unreach_select.check
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-06-08 17:52:36 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-06-09 14:55:49 +0200
commit97c338353dc0e83d93498ec486afbcff2aa9e931 (patch)
treeed9a53503f16c8a5a61a3a54ce035f01e2f8163b /test/files/neg/virtpatmat_unreach_select.check
parent43ae8259f2e01393219d1ece0c87614eece32621 (diff)
downloadscala-97c338353dc0e83d93498ec486afbcff2aa9e931.tar.gz
scala-97c338353dc0e83d93498ec486afbcff2aa9e931.tar.bz2
scala-97c338353dc0e83d93498ec486afbcff2aa9e931.zip
better unreachability for selections
Consts are hashconsed modulo static-approximation-for-dynamic-value-equality thus, two value-equality tests in patterns should reuse the same ValueConst if and only if the tested values are guaranteed to be equal in all possible executions the implementation uses unique types to track unique consts for an Ident with a stable symbol, we simply use the corresponding singleton type for a Select, we have to indirect some more: we store all the unique trees we've encountered and a unique type for each of them this unique type is then used to find the uniqut const that approximates the run-time value this may seem roundabout, but we need to standardize on types for representing "value" tests, as a type test against a singleton type must give rise to the same ValueConst as a value test using a tree that refers to the same symbol as the singleton type test
Diffstat (limited to 'test/files/neg/virtpatmat_unreach_select.check')
-rw-r--r--test/files/neg/virtpatmat_unreach_select.check4
1 files changed, 4 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