summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid MacIver <david.maciver@gmail.com>2008-10-25 11:20:43 +0000
committerDavid MacIver <david.maciver@gmail.com>2008-10-25 11:20:43 +0000
commit79a47b92e0dfafc0d0a4dbb898a2548a2e84d75a (patch)
tree475293c4785a91ec382b4666bf11558ae9fbd4ff
parent1f029a28d6d6c827158004417c62bec06b67d85c (diff)
downloadscala-79a47b92e0dfafc0d0a4dbb898a2548a2e84d75a.tar.gz
scala-79a47b92e0dfafc0d0a4dbb898a2548a2e84d75a.tar.bz2
scala-79a47b92e0dfafc0d0a4dbb898a2548a2e84d75a.zip
Making ParallelMatching a little less obnoxious...
Making ParallelMatching a little less obnoxious about swallowing exceptions.
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala28
1 files 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())
- }
}
}