diff options
author | Martin Odersky <odersky@gmail.com> | 2003-11-21 10:14:16 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-11-21 10:14:16 +0000 |
commit | d9fad519e8d13b10e38649f5605c3d7009bca558 (patch) | |
tree | 33dc32435ea7d0b0c590a1be4b5424d1c57c4ded /sources/scalac/typechecker/RefCheck.java | |
parent | c69637585f3d084b73d492371b45f4ab178fd438 (diff) | |
download | scala-d9fad519e8d13b10e38649f5605c3d7009bca558.tar.gz scala-d9fad519e8d13b10e38649f5605c3d7009bca558.tar.bz2 scala-d9fad519e8d13b10e38649f5605c3d7009bca558.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/typechecker/RefCheck.java')
-rw-r--r-- | sources/scalac/typechecker/RefCheck.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sources/scalac/typechecker/RefCheck.java b/sources/scalac/typechecker/RefCheck.java index 2aee3a04c4..3c39218c72 100644 --- a/sources/scalac/typechecker/RefCheck.java +++ b/sources/scalac/typechecker/RefCheck.java @@ -141,6 +141,12 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { } if (clazz.kind == CLASS && (clazz.flags & ABSTRACT) == 0) { if ((member.flags & DEFERRED) != 0) { + Type[] parents = clazz.parents(); + for (int i = 0; i < parents.length; i++) { + Symbol p = parents[i].symbol(); + if (p.isSubClass(member.owner()) && (p.flags & ABSTRACT) == 0) + return; // everything was already checked elsewhere + } abstractClassError( clazz, member + member.locationString() + " is not defined" + @@ -196,10 +202,19 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { * M must be labelled `abstract override'. */ void checkOverride(int pos, Symbol clazz, Symbol member, Symbol other) { + //System.out.println(member + member.locationString() + " overrides " + other + other.locationString() + " in " + clazz);//DEBUG if (member.owner() == clazz) pos = member.pos; else if (member.owner().isSubClass(other.owner())) return; // everything was already checked elsewhere + else { + Type[] parents = clazz.parents(); + for (int i = 0; i < parents.length; i++) { + Symbol p = parents[i].symbol(); + if (p.isSubClass(member.owner()) && p.isSubClass(other.owner())) + return; // everything was already checked elsewhere + } + } if ((member.flags & PRIVATE) != 0) { overrideError(pos, member, other, "has weaker access privileges; it should not be private"); @@ -531,7 +546,6 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { gen.mkRef(tree.pos, mvar)}); // def m: T = { if (m$ == null[T]) m$ = new m$class; m$ } - sym.updateInfo(Type.PolyType(Symbol.EMPTY_ARRAY, sym.type())); sym.flags |= STABLE; Tree ddef = gen.DefDef(sym, body); |