summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-05-01 14:56:12 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-05-01 14:56:12 +0000
commit6041bbcabc134151d80ac23590e20ad6ead953d4 (patch)
treee3dc20bc30488f035a5a0d6a81601a22f0eb144e /src/compiler
parent2043c0ab2196216fc1021d6d92e270184a2c8f45 (diff)
downloadscala-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.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/transform/AddInterfaces.scala6
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)
}
}