diff options
author | Burak Emir <emir@epfl.ch> | 2007-03-23 15:10:25 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-03-23 15:10:25 +0000 |
commit | b809bf2730a76316082b1e5ba8e6dcef48e7bbc3 (patch) | |
tree | f063d638ca83ea855dfa9afb303e156e599c10a0 /src | |
parent | f0a0e0cbe6e24743399134c61bdefa79f5d2c515 (diff) | |
download | scala-b809bf2730a76316082b1e5ba8e6dcef48e7bbc3.tar.gz scala-b809bf2730a76316082b1e5ba8e6dcef48e7bbc3.tar.bz2 scala-b809bf2730a76316082b1e5ba8e6dcef48e7bbc3.zip |
fixed bug related to default patterns
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index f28690ccba..59882a116b 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -57,9 +57,9 @@ trait ParallelMatching requires (transform.ExplicitOuter with PatternMatchers wi (ms,ss,(j,pat)::rs) case _ if (pat.symbol ne null) && (patternType =:= singleType(pat.symbol.tpe.prefix, pat.symbol))=> (EmptyTree::ms, (j,dummies)::ss, rs); // matching an object - case _ if pat.tpe <:< patternType => + case _ if (pat.tpe <:< patternType) => ({if(pat.tpe =:= patternType) EmptyTree else pat}::ms, (j,subpatterns(pat))::ss, rs); // subsumed (same or more specific) pattern; - case _ if patternType <:< pat.tpe => + case _ if (patternType <:< pat.tpe) || isDefaultPattern(pat) => (EmptyTree::ms, (j,dummies)::ss, (j,pat)::rs); // subsuming (matched *and* remaining pattern) case _ => (ms,ss,(j,pat)::rs) @@ -74,6 +74,7 @@ trait ParallelMatching requires (transform.ExplicitOuter with PatternMatchers wi } def getTransition(implicit theOwner: Symbol): (Symbol, Rep, Option[Rep]) = { + DEBUG("*** getTransition! of "+this.toString) // the following works for type tests... what fudge is necessary for value comparisons? // type test casted = if(scrutinee.tpe =:= patternType) scrutinee else newVar(scrutinee.pos, patternType) |