use of com.redhat.ceylon.model.typechecker.model.UnknownType in project ceylon-compiler by ceylon.
the class UnknownTypeCollector method collectUnknownTypes.
private void collectUnknownTypes(Type type, Map<Declaration, Declaration> visited) {
if (type != null) {
type = type.resolveAliases();
if (type.isUnknown()) {
UnknownType ut = (UnknownType) type.getDeclaration();
ut.reportErrors();
// don't report it twice
ut.setErrorReporter(null);
} else if (type.isUnion()) {
for (Type t : type.getCaseTypes()) {
collectUnknownTypesResolved(t, visited);
}
} else if (type.isIntersection()) {
for (Type t : type.getSatisfiedTypes()) {
collectUnknownTypesResolved(t, visited);
}
} else if (type.isUnknown() || type.isTypeParameter()) {
// do nothing
} else {
TypeDeclaration declaration = type.getDeclaration();
if (visited.put(declaration, declaration) != null)
return;
if (type.isClassOrInterface()) {
// these are not resolved
if (type.getExtendedType() != null)
collectUnknownTypes(type.getExtendedType(), visited);
for (Type t : type.getSatisfiedTypes()) collectUnknownTypes(t, visited);
}
}
}
}
Aggregations