diff options
author | Martin Odersky <odersky@gmail.com> | 2008-05-22 13:00:42 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-05-22 13:00:42 +0000 |
commit | 0bc0b0bbc65c4ece2be76c62c1dea58d4358a4d4 (patch) | |
tree | c094dde843c92f9a72d59380bd22db31f9033b26 /src/compiler | |
parent | e327bbb7bf463195c7eccaa2a399f283a849fdab (diff) | |
download | scala-0bc0b0bbc65c4ece2be76c62c1dea58d4358a4d4.tar.gz scala-0bc0b0bbc65c4ece2be76c62c1dea58d4358a4d4.tar.bz2 scala-0bc0b0bbc65c4ece2be76c62c1dea58d4358a4d4.zip |
fixed #911. Added comments to <~ and ~> methods.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index e971e4138d..216029b64f 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -446,11 +446,14 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { if (tree.symbol.isClassConstructor) { atOwner(tree.symbol) { val rhs1 = (rhs: @unchecked) match { - case Block(stat :: stats, expr) => - copy.Block( - rhs, - withInConstructorFlag(INCONSTRUCTOR) { transform(stat) } :: transformTrees(stats), - transform(expr)); + case Block(stats, expr) => + def transformInConstructor(stat: Tree) = + withInConstructorFlag(INCONSTRUCTOR) { transform(stat) } + val presupers = treeInfo.preSuperFields(stats) map transformInConstructor + val rest = stats drop presupers.length + val supercalls = rest take 1 map transformInConstructor + val others = rest drop 1 map transform + copy.Block(rhs, presupers ::: supercalls ::: others, transform(expr)) } copy.DefDef( tree, mods, name, transformTypeDefs(tparams), |