summaryrefslogtreecommitdiff
path: root/test/files/run/virtpatmat_literal.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2011-12-15 17:33:57 +0100
committerAdriaan Moors <adriaanm@gmail.com>2011-12-24 17:37:15 +0100
commitd4182c7f1473c8c831644da1a473e829345ce5a4 (patch)
tree7354ab603ac8f65555b30ac2c7da8bea08ece8cf /test/files/run/virtpatmat_literal.scala
parent0be2888938098f26a59115550073dde7f5dd7bd1 (diff)
downloadscala-d4182c7f1473c8c831644da1a473e829345ce5a4.tar.gz
scala-d4182c7f1473c8c831644da1a473e829345ce5a4.tar.bz2
scala-d4182c7f1473c8c831644da1a473e829345ce5a4.zip
[vpm] emitting switches -- BodyTreeMaker
1) introduce BodyTreeMaker to get rid of special casing for body now each case is a list of TreeMakers rather than a pair of such a list and a tree needed to do this since emitting switches requires access to the untranslated body 2) emitting switches - alternatives are flattened: each alternative block ends with a jump to the next alternative (if there is one) - to avoid stack overflow in typedMatch: detect when translateMatch returns a Match the patch to uncurry would be nicer with an extractor, but that breaks due to a bug in old patmat made trees into dags again -- NPE in erasure tree.duplicate seems to break lambdalift because it does not give fresh symbols (or trees?) to the valdefs for the arguments of duplicated functions duplicate enclosing tree, not subtrees improved propagateSubstitution for AlternativesTreeMaker - it now propagates to all its alternatives, so we don't have to do that in chainBefore - by making propagation more regular, a bug in substitution in AlternativesTreeMaker manifested itself it introduced a new binder, unnecessarily, which then was unbound -- now reusing binder of outer pattern having removeSubstOnly in propagateSubstitution unveiled a bug: guard treemaker should substitute move fixerUpper closer to what it fixes up
Diffstat (limited to 'test/files/run/virtpatmat_literal.scala')
-rw-r--r--test/files/run/virtpatmat_literal.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/files/run/virtpatmat_literal.scala b/test/files/run/virtpatmat_literal.scala
index cb72b1d2a5..5bd6b30791 100644
--- a/test/files/run/virtpatmat_literal.scala
+++ b/test/files/run/virtpatmat_literal.scala
@@ -1,8 +1,9 @@
object Test extends App {
+ val a = 1
1 match {
case 2 => println("FAILED")
case 1 => println("OK")
- case 1 => println("FAILED")
+ case `a` => println("FAILED")
}
val one = 1