diff options
author | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2013-08-20 19:19:32 +0200 |
---|---|---|
committer | Miguel Garcia <miguelalfredo.garcia@epfl.ch> | 2013-12-15 18:27:08 +0100 |
commit | c4e37d65213db205e41b95909612d16596444ca2 (patch) | |
tree | 8cdc5057c3048b1fe7c9197b33c3867134f19140 | |
parent | f1ca1a38231586b8401be87454825bb2e509749e (diff) | |
download | scala-c4e37d65213db205e41b95909612d16596444ca2.tar.gz scala-c4e37d65213db205e41b95909612d16596444ca2.tar.bz2 scala-c4e37d65213db205e41b95909612d16596444ca2.zip |
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
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala | 1 | ||||
-rw-r--r-- | test/files/pos/overzealous-assert-genbcode.scala | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index cda7af73f8..72d8d0a00f 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -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) diff --git a/test/files/pos/overzealous-assert-genbcode.scala b/test/files/pos/overzealous-assert-genbcode.scala new file mode 100644 index 0000000000..ddd70b0c44 --- /dev/null +++ b/test/files/pos/overzealous-assert-genbcode.scala @@ -0,0 +1,10 @@ +object Test { + + def main(args: Array[String]) { + args(0) match { + case a: String => while(a == null) {} + } + } + +} + |