diff options
author | paltherr <paltherr@epfl.ch> | 2004-01-07 17:34:49 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-01-07 17:34:49 +0000 |
commit | 84f921cf1c1d843a24570aa66e4362cd4d0dc2ba (patch) | |
tree | a21190910df1f2f57d056bf6721b53c117a968a2 /sources/scalac/symtab | |
parent | 3186eaed671358a9075fe50f89a20049a9e26852 (diff) | |
download | scala-84f921cf1c1d843a24570aa66e4362cd4d0dc2ba.tar.gz scala-84f921cf1c1d843a24570aa66e4362cd4d0dc2ba.tar.bz2 scala-84f921cf1c1d843a24570aa66e4362cd4d0dc2ba.zip |
- Rewrote ExplicitOuterClassesPhase with a new ...
- Rewrote ExplicitOuterClassesPhase with a new scheme for outer types
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r-- | sources/scalac/symtab/Type.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index 04db29f6f0..f0d4a7ce1f 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -1280,7 +1280,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { Type[] args1 = map(args); if (prefix1 == prefix && args1 == args) return t; Symbol sym1 = prefix1.rebind(sym); - if (local && sym != sym1) { + if (local && sym != sym1 && sym1.isClassType()) { // Here what we should do is remove the outer // type links of sym from args and then add // the outer type links of sym1 to @@ -1290,6 +1290,22 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { // outer), we can just replace args by the // outer type params of sym1. args1 = asSeenFrom(Symbol.type(sym1.owner().typeParams()), pre, sym1.owner()); + { + // we need also to add the type of the outer link + Type p = prefix1; + Symbol s = sym1.owner(); + while (true) { + if (s.isPackage()) break; + if (s.isModuleClass()) { + s = s.owner(); + p = p.prefix().baseType(s); + } else { + args1 = cloneArray(args1, 1); + args1[args1.length - 1] = p; + break; + } + } + } if (sym1.isClassType()) prefix1 = localThisType; } Type t1 = typeRef(prefix1, sym1, args1); |