From 6041bbcabc134151d80ac23590e20ad6ead953d4 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Tue, 1 May 2007 14:56:12 +0000 Subject: Fixed bug #1076, AddInterfaces assumed the call... Fixed bug #1076, AddInterfaces assumed the call to super constructor always comes first in a ctor. --- src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/compiler') 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) } } -- cgit v1.2.3