From 9772ebe8ecfcbffb78b862a79320f40c9c26e7f1 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 11 Jan 2010 04:58:17 +0000 Subject: Fix for an unfortunate bug introduced in r19020... Fix for an unfortunate bug introduced in r19020 which was causing a great many unnecessary and unreachable MatchErrors to appear in generated bytecode. --- src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index fd4b57ef67..7fce0ee73a 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -280,7 +280,9 @@ trait ParallelMatching extends ast.TreeDSL lazy val pvgroup = PatternVarGroup.fromBindings(subst.get()) - final def tree(): Tree = squeezedBlock(pvgroup.valDefs, codegen) + final def tree(): Tree = + if (guard.isEmpty) success + else squeezedBlock(pvgroup.valDefs, codegen) } /** Mixture rule for all literal ints (and chars) i.e. hopefully a switch -- cgit v1.2.3