diff options
author | Martin Odersky <odersky@gmail.com> | 2006-09-20 12:07:23 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-09-20 12:07:23 +0000 |
commit | 5a5eb8196cdba0dee74f536445286699b0543a22 (patch) | |
tree | 5ebaaa3c1130215d128fc339a7e71390a818a062 | |
parent | aafc72b3df6b79cda186e5faaab8f92cfc62908d (diff) | |
download | scala-5a5eb8196cdba0dee74f536445286699b0543a22.tar.gz scala-5a5eb8196cdba0dee74f536445286699b0543a22.tar.bz2 scala-5a5eb8196cdba0dee74f536445286699b0543a22.zip |
fixed bug744
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 0d0e9b69e1..468e6bf118 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -251,9 +251,16 @@ abstract class AddInterfaces extends InfoTransform { def mixinConstructorCall(mixinClass: Symbol): Tree = atPos(tree.pos) { Apply(Select(This(clazz), mixinClass.primaryConstructor), List()) } + def toImplClass(mc: Symbol) = + if (mc.isImplClass) mc else implClass(mc) + def hasMixinConstructor(mc: Symbol) = { + mc.info; + (mc.isImplClass || mc.needsImplClass) && mc.toInterface != ScalaObjectClass + } val mixinConstructorCalls: List[Tree] = { - for (val mc <- clazz.mixinClasses.reverse; mc.isImplClass && mc.toInterface != ScalaObjectClass) - yield mixinConstructorCall(mc) + Console.println("mixin constr "+clazz.info.baseClasses + "/" + clazz.mixinClasses) + for (val mc <- clazz.mixinClasses.reverse; hasMixinConstructor(mc)) + yield mixinConstructorCall(toImplClass(mc)) } tree match { //todo: remove checking code case Block(supercall :: stats, expr) => |