diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-05-01 14:56:12 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-05-01 14:56:12 +0000 |
commit | 6041bbcabc134151d80ac23590e20ad6ead953d4 (patch) | |
tree | e3dc20bc30488f035a5a0d6a81601a22f0eb144e | |
parent | 2043c0ab2196216fc1021d6d92e270184a2c8f45 (diff) | |
download | scala-6041bbcabc134151d80ac23590e20ad6ead953d4.tar.gz scala-6041bbcabc134151d80ac23590e20ad6ead953d4.tar.bz2 scala-6041bbcabc134151d80ac23590e20ad6ead953d4.zip |
Fixed bug #1076, AddInterfaces assumed the call...
Fixed bug #1076, AddInterfaces assumed the call to super constructor
always comes first in a ctor.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 0179580e05..815b36b361 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -292,8 +292,10 @@ abstract class AddInterfaces extends InfoTransform { yield mixinConstructorCall(implClass(mc)) } (tree: @unchecked) match { - case Block(supercall :: stats, expr) => - copy.Block(tree, supercall :: mixinConstructorCalls ::: stats, expr) + case Block(stats, expr) => + val (presuper, supercall :: rest) = stats span (_.symbol.hasFlag(PRESUPER)) + //assert(supercall.symbol.isClassConstructor, supercall) + copy.Block(tree, presuper ::: (supercall :: mixinConstructorCalls ::: rest), expr) } } |