diff options
author | Martin Odersky <odersky@gmail.com> | 2006-11-10 15:43:32 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-11-10 15:43:32 +0000 |
commit | 12014a82a3097a3cdb48f089a16aa5f44df8d6d6 (patch) | |
tree | 1c462635a200f0516cbd37200dde22e6d26f6193 /src | |
parent | a90beca18ea6ece5bb0cff2814b779448a871ad3 (diff) | |
download | scala-12014a82a3097a3cdb48f089a16aa5f44df8d6d6.tar.gz scala-12014a82a3097a3cdb48f089a16aa5f44df8d6d6.tar.bz2 scala-12014a82a3097a3cdb48f089a16aa5f44df8d6d6.zip |
Fixed bug809
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 16 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 680aec5c5b..e12c6dfe7e 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1650,7 +1650,8 @@ trait Types requires SymbolTable { private def adaptToNewRun(pre: Type, sym: Symbol): Symbol = { if (sym.isModuleClass && !phase.flatClasses) adaptToNewRun(pre, sym.sourceModule).moduleClass - else if ((pre eq NoPrefix) || (pre eq NoType) || sym.owner.isPackageClass) sym + else if ((pre eq NoPrefix) || (pre eq NoType)) sym + else if (sym.owner.isPackageClass) sym.owner.info.decl(sym.name) else { var rebind0 = pre.findMember(sym.name, BRIDGE, 0, true) /** The two symbols have the same fully qualified name */ diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index dbaef1d3e4..24be97f712 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -74,7 +74,10 @@ abstract class Mixin extends InfoTransform { /** The implementation class corresponding to a currently compiled interface. * todo: try to use Symbol.implClass instead? */ - private def implClass(iface: Symbol): Symbol = erasure.implClass(iface) + private def implClass(iface: Symbol): Symbol = { + val impl = iface.implClass + if (impl != NoSymbol) impl else erasure.implClass(iface) + } /** Returns the symbol that is accessed by a super-accessor in a mixin composition. * @@ -187,6 +190,17 @@ abstract class Mixin extends InfoTransform { assert (impl.isImplClass) for (val member <- impl.info.decls.toList) { if (isForwarded(member)) { + for (val im <- iface.info.member(member.name).alternatives) { + // There's a subtle reason why we need to complete the interface symbol: + // It might be that the type of the interface symbol refers to + // an abstract type in the interface bounded by a nested class outside + // the interface. Assume now that the nested class is recompiled in resident mode. + // The interface symbol will be valid for the whole run because + // the abstract type has not changed. But the erased type *has* changed + // and therefore needs to be updated. See bug809 for an example where + // this comes up. + im.info.complete(im) + } val imember = member.overriddenSymbol(iface) //Console.println("mixin member "+member+":"+member.tpe+member.locationString+" "+imember+" "+imember.overridingSymbol(clazz)+" to "+clazz+" with scope "+clazz.info.decls)//DEBUG if (imember.overridingSymbol(clazz) == NoSymbol && |