diff options
author | Martin Odersky <odersky@gmail.com> | 2009-11-08 12:10:10 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-11-08 12:10:10 +0000 |
commit | b2bf6d3d0956516a0d86d3d158bf7d94d7ac0cd1 (patch) | |
tree | e6dedcf0959d46c2c5ac60ed5fabd55f10e1385e | |
parent | 2ac62aa9e91b58314e18641b1b831afb7d80741c (diff) | |
download | scala-b2bf6d3d0956516a0d86d3d158bf7d94d7ac0cd1.tar.gz scala-b2bf6d3d0956516a0d86d3d158bf7d94d7ac0cd1.tar.bz2 scala-b2bf6d3d0956516a0d86d3d158bf7d94d7ac0cd1.zip |
Fixed #2503
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 9293ab4c3f..25f418bc19 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -1307,11 +1307,15 @@ trait Symbols { site.nonPrivateMember(name).filter(sym => !sym.isTerm || (site.memberType(this) matches site.memberType(sym))) - /** The symbol overridden by this symbol in given class `ofclazz' */ + /** The symbol overridden by this symbol in given class `ofclazz'. + * @pre 'ofclazz' is a base class of this symbol's owner. + */ final def overriddenSymbol(ofclazz: Symbol): Symbol = if (isClassConstructor) NoSymbol else matchingSymbol(ofclazz, owner.thisType) - /** The symbol overriding this symbol in given subclass `ofclazz' */ + /** The symbol overriding this symbol in given subclass `ofclazz' + * @pre: `ofclazz' is a subclass of this symbol's owner + */ final def overridingSymbol(ofclazz: Symbol): Symbol = if (isClassConstructor) NoSymbol else matchingSymbol(ofclazz, ofclazz.thisType) diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index b6187204d8..36479586a7 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -98,14 +98,14 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { var sym: Symbol = NoSymbol if (settings.debug.value) log("starting rebindsuper " + base + " " + member + ":" + member.tpe + - " " + mixinClass + " " + base.info.baseClasses) + " " + mixinClass + " " + base.info.baseClasses + "/" + bcs) while (!bcs.isEmpty && sym == NoSymbol) { if (settings.debug.value) { val other = bcs.head.info.nonPrivateDecl(member.name); log("rebindsuper " + bcs.head + " " + other + " " + other.tpe + " " + other.isDeferred) } - sym = member.overridingSymbol(bcs.head).suchThat(sym => !sym.hasFlag(DEFERRED | BRIDGE)) + sym = member.matchingSymbol(bcs.head, base.thisType).suchThat(sym => !sym.hasFlag(DEFERRED | BRIDGE)) bcs = bcs.tail } assert(sym != NoSymbol, member) |