diff options
author | paltherr <paltherr@epfl.ch> | 2003-10-02 12:32:05 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-10-02 12:32:05 +0000 |
commit | f1182273dd9661485c26733bde8622863cdce282 (patch) | |
tree | ec4bfc00c69240a00302fbd51cc102c73bba3d21 | |
parent | 615be6cee221896375b4e1ba03f7e68ffd45fa67 (diff) | |
download | scala-f1182273dd9661485c26733bde8622863cdce282.tar.gz scala-f1182273dd9661485c26733bde8622863cdce282.tar.bz2 scala-f1182273dd9661485c26733bde8622863cdce282.zip |
- Fixed overriddenSymbol for phases after erasure
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 6fa6a0db04..c8ab34bd07 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -1125,6 +1125,9 @@ public abstract class Symbol implements Modifiers, Kinds { * `base' must be a superclass of this.owner(). */ public Symbol overriddenSymbol(Type base) { + return overriddenSymbol(base, false); + } + public Symbol overriddenSymbol(Type base, boolean exact) { assert !isOverloaded() : this; Symbol sym1 = base.lookupNonPrivate(name); if (sym1.kind == Kinds.NONE || (sym1.flags & STATIC) != 0) { @@ -1137,14 +1140,18 @@ public abstract class Symbol implements Modifiers, Kinds { switch (sym1type) { case OverloadedType(Symbol[] alts, Type[] alttypes): for (int i = 0; i < alts.length; i++) { - if (symtype.isSubType(alttypes[i].derefDef())) + if (exact + ? symtype.isSameAs(alttypes[i].derefDef()) + : symtype.isSubType(alttypes[i].derefDef())) return alts[i]; } return Symbol.NONE; default: - if (symtype.isSubType(sym1type)) return sym1; + if (exact + ? symtype.isSameAs(sym1type) + : symtype.isSubType(sym1type)) return sym1; else { - if (Global.instance.debug) System.out.println(this + locationString() + " does not override " + sym1 + sym1.locationString() + ", since " + symtype + " !<= " + sym1type);//DEBUG + if (Global.instance.debug) System.out.println(this + locationString() + " does not override " + sym1 + sym1.locationString() + ", since " + symtype + (exact ? " != " : " !<= ") + sym1type);//DEBUG return Symbol.NONE; } } |