summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-11-18 17:02:55 +0000
committerpaltherr <paltherr@epfl.ch>2004-11-18 17:02:55 +0000
commit233229a0f801998b4aab15f81fed417d86f8ad6e (patch)
tree19ae70a848508a8819f23f79e70a7a3d1f72893d /sources
parentd2b5a0ad16ca39ab45fa8f8f2155ac6bea79425d (diff)
downloadscala-233229a0f801998b4aab15f81fed417d86f8ad6e.tar.gz
scala-233229a0f801998b4aab15f81fed417d86f8ad6e.tar.bz2
scala-233229a0f801998b4aab15f81fed417d86f8ad6e.zip
- Fixed class ClonedThisSymLazyType to take int...
- Fixed class ClonedThisSymLazyType to take into account that clasz.type() may appear anywhere in clasz.typeOfThis().
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/Symbol.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 3f2289f214..d2bbd8f8b7 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -2186,27 +2186,31 @@ public class ClassSymbol extends TypeSymbol {
Symbol clone = symbol.owner();
Type.Map map =
Type.getSubst(clasz.typeParams(), clone.typeParams());
+ Type self = clasz.type();
Type type = clasz.typeOfThis();
- Type self = clone.type();
switch (type) {
case CompoundType(Type[] parents1, Scope members):
assert members.isEmpty(): Debug.show(clasz, type);
int length = parents1.length;
Type[] parents2 = new Type[parents1.length];
+ boolean has_self = false;
for (int i = 0; i < parents2.length; i++) {
- parents2[i] = fix(parents1[i], clasz, clone, map);
- if (i != parents2.length - 1)
- assert !self.isSubType(parents2[i]):
- Debug.show(clasz, clone, type, ""+i, parents2[i]);
+ if (self.isSameAs(parents1[i])) {
+ assert !has_self: Debug.show(clasz, clone, type,""+i);
+ parents2[i] = clone.type();
+ has_self = true;
+ } else {
+ parents2[i] = fix(parents1[i], clasz, clone, map);
+ }
}
- if (!self.isSubType(parents2[parents2.length - 1]))
+ if (!has_self) {
parents2 = Type.cloneArray(parents2, 1);
- parents2[parents2.length - 1] = self;
+ parents2[parents2.length - 1] = clone.type();
+ }
return Type.compoundTypeWithOwner(clone, parents2, members);
default:
- type = fix(type, clasz, clone, map);
- if (self.isSubType(type)) return self;
- Type[] parents = new Type[]{type, self};
+ if (self.isSameAs(type)) return clone.type();
+ Type[] parents = {fix(type, clasz, clone, map), clone.type()};
return Type.compoundTypeWithOwner(clone, parents, new Scope());
}
}