diff options
author | Martin Odersky <odersky@gmail.com> | 2003-10-08 14:52:49 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-10-08 14:52:49 +0000 |
commit | 66077bf0c6211cbdc0109195c7a28be82b0f4261 (patch) | |
tree | df36968fa3ae4cffe09fcb6d90fa74a559f0fe25 /sources/scalac/symtab/Type.java | |
parent | 9d803bdc8a1001bcbe39bf836d837f07a320ec25 (diff) | |
download | scala-66077bf0c6211cbdc0109195c7a28be82b0f4261.tar.gz scala-66077bf0c6211cbdc0109195c7a28be82b0f4261.tar.bz2 scala-66077bf0c6211cbdc0109195c7a28be82b0f4261.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/Type.java')
-rw-r--r-- | sources/scalac/symtab/Type.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index e9e4d3b024..fac8f18f48 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -6,7 +6,7 @@ ** $Id$ \* */ //todo: T {} == T - +//todo: ELiminate phase dependency in AsSeenFromMap package scalac.symtab; @@ -997,12 +997,14 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { * or `sym' itself if none exists. */ public Symbol rebind(Symbol sym) { - Symbol sym1 = lookupNonPrivate(sym.name); - if (sym1.kind != NONE) { - if ((sym1.flags & LOCKED) != 0) - throw new Type.Error("illegal cyclic reference involving " + sym1); - //System.out.println("rebinding " + sym + " to " + sym1);//DEBUG - return sym1; + if ((sym.flags & (PRIVATE | MODUL)) == 0) { + Symbol sym1 = lookupNonPrivate(sym.name); + if (sym1.kind != NONE) { + if ((sym1.flags & LOCKED) != 0) + throw new Type.Error("illegal cyclic reference involving " + sym1); + //System.out.println("rebinding " + sym + " to " + sym1);//DEBUG + return sym1; + } } return sym; } @@ -1042,7 +1044,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { Type prefix1 = apply(prefix); Type[] args1 = map(args); if (prefix1 == prefix && args1 == args) return t; - Symbol sym1 = (sym.flags & MODUL) == 0 ? prefix1.rebind(sym) : sym; + Symbol sym1 = prefix1.rebind(sym); if (local && sym != sym1) { // Here what we should do is remove the outer // type links of sym from args and then add @@ -1110,7 +1112,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { } /** This type as seen from prefix `pre' and class `clazz'. This means: - * Replace all thistypes of `clazz' or one of its superclasses by `pre' + * Replace all thistypes of `clazz' or one of its subclasses by `pre' * and instantiate all parameters by arguments of `pre'. * Proceed analogously for thistypes referring to outer classes. */ |