summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-05-25 08:54:06 +0000
committerschinz <schinz@epfl.ch>2005-05-25 08:54:06 +0000
commit1af5b9aeedd8bbcc897077bd837b8b0827cf94f8 (patch)
tree148a88a4595ae10a07317a3291cf7d07dc38bafb
parent0f61edd914d4fcfaaebe014f5c5c71b2dc26c9ff (diff)
downloadscala-1af5b9aeedd8bbcc897077bd837b8b0827cf94f8.tar.gz
scala-1af5b9aeedd8bbcc897077bd837b8b0827cf94f8.tar.bz2
scala-1af5b9aeedd8bbcc897077bd837b8b0827cf94f8.zip
- bug fix: include compound types in the comput...
- bug fix: include compound types in the computation of the set of constructors needed to compute the parents of a class, - bug fix: handle abstract type members in the detection of classes whose parents have to be computed lazily (thanks Philippe)
-rw-r--r--sources/scalac/transformer/TypesAsValuesPhase.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/sources/scalac/transformer/TypesAsValuesPhase.java b/sources/scalac/transformer/TypesAsValuesPhase.java
index 52b84333fe..394373bd94 100644
--- a/sources/scalac/transformer/TypesAsValuesPhase.java
+++ b/sources/scalac/transformer/TypesAsValuesPhase.java
@@ -975,6 +975,9 @@ public class TypesAsValuesPhase extends Phase {
addConstructorsNeededBy(roots, args[i], set);
}
break;
+ case CompoundType(Type[] parts, _):
+ for (int i = 0; i < parts.length; ++i)
+ addConstructorsNeededBy(roots, parts[i], set);
default:
; // nothing to do
}
@@ -1000,7 +1003,16 @@ public class TypesAsValuesPhase extends Phase {
}
private boolean isCyclic(Symbol sym) {
- return constructorsNeededBy(sym).contains(sym);
+ HashSet constrs = constructorsNeededBy(sym);
+ if (constrs.contains(sym))
+ return true;
+ Iterator constrsIt = constrs.iterator();
+ while (constrsIt.hasNext()) {
+ Symbol constr = (Symbol)constrsIt.next();
+ if (constr.isAbstractType())
+ return true;
+ }
+ return false;
}
/**