summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-01-18 04:33:27 -0800
committerJason Zaugg <jzaugg@gmail.com>2014-01-18 04:33:27 -0800
commit338b053563e6c57eec157bc19697349782475926 (patch)
tree923b6b94fb3e004b789a45c7bdfe57e5630f47b0 /src
parentb3ad7534fb99df9ea0a64e4ba929311c72175709 (diff)
parent1baf11a2bb4ed3c816e0484238b426bc0318c27c (diff)
downloadscala-338b053563e6c57eec157bc19697349782475926.tar.gz
scala-338b053563e6c57eec157bc19697349782475926.tar.bz2
scala-338b053563e6c57eec157bc19697349782475926.zip
Merge pull request #3356 from retronym/ticket/8138
Fix bug with super-accessors / dependent types
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala12
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 430129aaff..e61b35a621 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -878,11 +878,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)