Permalink
Browse files

overzealous assert in GenBCode

The assert in question was aimed at ruling out
gotos (ie "jumping-applys") in actual argument position
of a jumping-apply.

But the assert in question went overboard
to also rule out a LabelDef in actual argument position.

This commit removes the assert in question altogether.

The unwanted behaviors, and only those, are rule out by
the test added in this commit and the existing tests for SI-6089.

See also https://issues.scala-lang.org/browse/SI-7749
  • Loading branch information...
magarciaEPFL committed Aug 20, 2013
1 parent f1ca1a3 commit c4e37d65213db205e41b95909612d16596444ca2
@@ -824,7 +824,6 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
/* Generate code that loads args into label parameters. */
def genLoadLabelArguments(args: List[Tree], lblDef: LabelDef, gotoPos: Position) {
- assert(args forall { a => !a.hasSymbolField || a.hasSymbolWhich( s => !s.isLabel) }, s"SI-6089 at: $gotoPos") // SI-6089
val aps = {
val params: List[Symbol] = lblDef.params.map(_.symbol)
@@ -0,0 +1,10 @@
+object Test {
+
+ def main(args: Array[String]) {
+ args(0) match {
+ case a: String => while(a == null) {}
+ }
+ }
+
+}
+

0 comments on commit c4e37d6

Please sign in to comment.