diff options
author | Paul Phillips <paulp@improving.org> | 2009-07-11 05:02:16 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-07-11 05:02:16 +0000 |
commit | 2bc40d593a84a510ccf18b1666a419f77665fcb4 (patch) | |
tree | 085c34b88c3f46ef8aaf8243bcaddd6ac1a51826 /src/compiler | |
parent | 8ee2c8685d4edb2d0c285aeb6fa9b2a99b8a9e79 (diff) | |
download | scala-2bc40d593a84a510ccf18b1666a419f77665fcb4.tar.gz scala-2bc40d593a84a510ccf18b1666a419f77665fcb4.tar.bz2 scala-2bc40d593a84a510ccf18b1666a419f77665fcb4.zip |
Fix and test case for #1260.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 10 |
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)) ) |