From c6a4f7ec60a874fd937a1d98711eeb9f03a8d796 Mon Sep 17 00:00:00 2001 From: paltherr Date: Mon, 6 Oct 2003 11:10:38 +0000 Subject: - Reverted changes done to toPrefix - Fixed prefix computation in AsSeenFrom.apply --- sources/scalac/symtab/Type.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sources') 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 -- cgit v1.2.3