summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-06 11:10:38 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-06 11:10:38 +0000
commitc6a4f7ec60a874fd937a1d98711eeb9f03a8d796 (patch)
tree5dd75f47216a3254de9458e7e9b5422e3a9a2372 /sources
parent84b6d995fd694669eed8c5df8ca70b6c56288252 (diff)
downloadscala-c6a4f7ec60a874fd937a1d98711eeb9f03a8d796.tar.gz
scala-c6a4f7ec60a874fd937a1d98711eeb9f03a8d796.tar.bz2
scala-c6a4f7ec60a874fd937a1d98711eeb9f03a8d796.zip
- Reverted changes done to toPrefix
- Fixed prefix computation in AsSeenFrom.apply
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/Type.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 2a5ff38def..2d64dbfe3b 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -1039,8 +1039,13 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
//System.out.println(t + ".toInstance(" + pre + "," + clazz + ") = " + t1);//DEBUG
return t1;
} else {
- if (local) prefix = sym.owner().thisType();
- Type prefix1 = apply(prefix);
+ Type prefix1 = prefix;
+ if (!local) {
+ prefix1 = apply(prefix);
+ } else if (sym.isAbstractType()) {
+ prefix = sym.owner().thisType();
+ prefix1 = prefix.asSeenFrom(pre, sym.owner());
+ }
Type[] args1 = map(args);
if (prefix1 == prefix && args1 == args) return t;
Symbol sym1 = (sym.flags & MODUL) == 0 ? prefix1.rebind(sym) : sym;
@@ -1101,7 +1106,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
Type toPrefix(Symbol sym, Type pre, Symbol clazz) {
if (pre == NoType || clazz.kind != CLASS)
return this;
- else if ((sym.isSubClass(clazz) || clazz.isSubClass(sym)) &&
+ else if (sym.isSubClass(clazz) &&
pre.widen().symbol().isSubClass(sym))
return pre;
else