diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-04 22:04:09 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-13 21:47:51 -0800 |
commit | 066b1a1f5d80e1a314d6e96a9a8c0b4d76a8c7a1 (patch) | |
tree | 93cdc628540dc0d1192a82155668b0dba64b1b99 /src | |
parent | d7981e784e11e8a5a9a761f28d90725d721c9475 (diff) | |
download | scala-066b1a1f5d80e1a314d6e96a9a8c0b4d76a8c7a1.tar.gz scala-066b1a1f5d80e1a314d6e96a9a8c0b4d76a8c7a1.tar.bz2 scala-066b1a1f5d80e1a314d6e96a9a8c0b4d76a8c7a1.zip |
Fix for crasher in uncurry.
A small dose of packedType closes SI-4869.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 4ae4042cc7..2e2ff23881 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -271,10 +271,14 @@ abstract class UnCurry extends InfoTransform def missingCaseCall(scrutinee: Tree): Tree = Apply(Select(This(anonClass), nme.missingCase), List(scrutinee)) def applyMethodDef() = { - val body = + val body = localTyper.typedPos(fun.pos) { if (isPartial) gen.mkUncheckedMatch(gen.withDefaultCase(fun.body, missingCaseCall)) else fun.body - DefDef(Modifiers(FINAL), nme.apply, Nil, List(fun.vparams), TypeTree(restpe), body) setSymbol applyMethod + } + // Have to repack the type to avoid mismatches when existentials + // appear in the result - see SI-4869. + val applyResultType = localTyper.packedType(body, applyMethod) + DefDef(Modifiers(FINAL), nme.apply, Nil, List(fun.vparams), TypeTree(applyResultType), body) setSymbol applyMethod } def isDefinedAtMethodDef() = { val isDefinedAtName = { |