diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-01-18 10:44:12 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-01-18 10:45:59 -0800 |
commit | 0d74502ce5657c8b64575dac1663a24d287ecb0d (patch) | |
tree | 717befc6a81467fe5837ef59696c915baff69659 /src | |
parent | 0beca4b2f039fb21222cef29c1b7b5a012df5e61 (diff) | |
parent | 338b053563e6c57eec157bc19697349782475926 (diff) | |
download | scala-0d74502ce5657c8b64575dac1663a24d287ecb0d.tar.gz scala-0d74502ce5657c8b64575dac1663a24d287ecb0d.tar.bz2 scala-0d74502ce5657c8b64575dac1663a24d287ecb0d.zip |
Merge 2.10.x into master
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index ef50ae276f..e193cf3de2 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -685,11 +685,13 @@ abstract class UnCurry extends InfoTransform case Packed(param, tempVal) => (param, tempVal) }.unzip - val rhs1 = localTyper.typedPos(rhs.pos) { - // Patch the method body to refer to the temp vals - val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol)) - // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> } - Block(tempVals, rhsSubstituted) + val rhs1 = if (tempVals.isEmpty) rhs else { + localTyper.typedPos(rhs.pos) { + // Patch the method body to refer to the temp vals + val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol)) + // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> } + Block(tempVals, rhsSubstituted) + } } (allParams :: Nil, rhs1) |