From 79a47b92e0dfafc0d0a4dbb898a2548a2e84d75a Mon Sep 17 00:00:00 2001 From: David MacIver Date: Sat, 25 Oct 2008 11:20:43 +0000 Subject: Making ParallelMatching a little less obnoxious... Making ParallelMatching a little less obnoxious about swallowing exceptions. --- .../tools/nsc/matching/ParallelMatching.scala | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index e1bc8b1518..6a02957e3e 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -708,16 +708,13 @@ trait ParallelMatching { } /** returns true if pattern tests an object */ - final def objectPattern(pat:Tree): Boolean = try { + final def objectPattern(pat:Tree): Boolean = { (pat.symbol ne null) && (pat.symbol != NoSymbol) && pat.symbol.tpe.prefix.isStable && headPatternType =:= singleType(pat.symbol.tpe.prefix, pat.symbol) - } catch { - case e => - Console.println("object pattern test throws "+e.getMessage()) - throw e } + /*init block*/ { var sr = (moreSpecific,subsumed,remaining) var j = 0; var pats = column; while(pats ne Nil) { @@ -819,24 +816,19 @@ trait ParallelMatching { val cfa = if (!isCaseHead) Nil else casted.caseFieldAccessors val caseTemps = (if (!srep.temp.isEmpty && srep.temp.head == casted) srep.temp.tail else srep.temp).zip(cfa) - try{ - var vdefs = caseTemps map { - p => - val tmp = p._1; - val accessorMethod = p._2 - val untypedAccess = Apply(Select(mkIdent(casted), accessorMethod),List()) - val typedAccess = typed { untypedAccess } - typedValDef(tmp, typedAccess) - } + var vdefs = caseTemps map { + p => + val tmp = p._1; + val accessorMethod = p._2 + val untypedAccess = Apply(Select(mkIdent(casted), accessorMethod),List()) + val typedAccess = typed { untypedAccess } + typedValDef(tmp, typedAccess) + } if (casted ne this.scrutinee) vdefs = ValDef(casted, gen.mkAsInstanceOf(mkIdent(this.scrutinee), casted.tpe)) :: vdefs return typed { If(cond, squeezedBlock(vdefs, succ), fail) } - } catch { - case e => - throw new FatalError("EXCEPTION:"+e.getMessage()) - } } } -- cgit v1.2.3