summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index c79385488a..ecf3dddfea 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -983,10 +983,12 @@ trait ParallelMatching extends ast.TreeDSL {
val fail = frep map (_.toTree) getOrElse (failTree)
// dig out case field accessors that were buried in (***)
- val cfa = if (pats.isCaseHead) casted.accessors else Nil
- val caseTemps = srep.tvars match { case x :: xs if x == casted.sym => xs ; case x => x }
- def needCast = if (casted.sym ne scrut.sym) List(VAL(casted.sym) === (scrut.id AS_ANY castedTpe)) else Nil
- val vdefs = needCast ::: (
+ val cfa = if (pats.isCaseHead) casted.accessors else Nil
+ val caseTemps = srep.tvars match { case x :: xs if x == casted.sym => xs ; case x => x }
+ def castedScrut = typedValDef(casted.sym, scrut.id AS castedTpe)
+ def needCast = if (casted.sym ne scrut.sym) List(castedScrut) else Nil
+
+ val vdefs = needCast ::: (
for ((tmp, accessor) <- caseTemps zip cfa) yield
typedValDef(tmp, typer typed fn(casted.id, accessor))
)