summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-08 13:21:46 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-08 13:21:46 +0000
commited28110153269312ccf587153a988e9a1c67f692 (patch)
tree6f475cf054c689b22aa76614eef9cc0cb005d5a9
parentfebb62721c74d18c16933012dd2d09f7a5af2ed6 (diff)
downloadscala-ed28110153269312ccf587153a988e9a1c67f692.tar.gz
scala-ed28110153269312ccf587153a988e9a1c67f692.tar.bz2
scala-ed28110153269312ccf587153a988e9a1c67f692.zip
- Fixed prefix handling for TypeAliases and Abs...
- Fixed prefix handling for TypeAliases and AbstractTypes
-rw-r--r--sources/scalac/symtab/Type.java10
-rw-r--r--sources/scalac/transformer/ExplicitOuterClassesPhase.java8
2 files changed, 9 insertions, 9 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 578c628996..e9e4d3b024 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -1039,13 +1039,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
//System.out.println(t + ".toInstance(" + pre + "," + clazz + ") = " + t1);//DEBUG
return t1;
} else {
- Type prefix1 = prefix;
- if (!local) {
- prefix1 = apply(prefix);
- } else if (sym.isAbstractType()) {
- prefix = sym.owner().thisType();
- prefix1 = prefix.asSeenFrom(pre, sym.owner());
- }
+ 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;
@@ -1059,8 +1053,8 @@ 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());
+ if (sym1.isClassType()) prefix1 = localThisType;
}
- if (local) prefix1 = localThisType;
Type t1 = typeRef(prefix1, sym1, args1);
if (sym1 != sym) t1 = apply(t1.unalias());
return t1;
diff --git a/sources/scalac/transformer/ExplicitOuterClassesPhase.java b/sources/scalac/transformer/ExplicitOuterClassesPhase.java
index 4efb1dced7..513c508297 100644
--- a/sources/scalac/transformer/ExplicitOuterClassesPhase.java
+++ b/sources/scalac/transformer/ExplicitOuterClassesPhase.java
@@ -218,7 +218,13 @@ public class ExplicitOuterClassesPhase extends Phase {
prefix = apply(prefix);
targs = map(targs);
targs = Type.concat(getOuterTypeArgs(prefix, symbol), targs);
- return Type.TypeRef(Type.localThisType, symbol, targs);
+ if (symbol.isClassType()) {
+ // !!! add assertions ?
+ prefix = Type.localThisType;
+ } else {
+ // !!! replace outer ThisTypes by SingleTypes to outer link
+ }
+ return Type.TypeRef(prefix, symbol, targs);
}
return map(type);
}