fix attempt to create JetTypeImpl with ErrorScope

ErrorScope is created here if any typeParameterDescriptor upper bounds scope is ErrorScope
This commit is contained in:
Stepan Koltsov
2012-01-25 21:28:46 +04:00
parent f6019018d1
commit 3a09f69f9b
@@ -80,13 +80,18 @@ public class TypeResolver {
trace.record(BindingContext.REFERENCE_TARGET, referenceExpression, typeParameterDescriptor);
result[0] = new JetTypeImpl(
annotations,
typeParameterDescriptor.getTypeConstructor(),
nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor),
Collections.<TypeProjection>emptyList(),
getScopeForTypeParameter(typeParameterDescriptor)
);
JetScope scopeForTypeParameter = getScopeForTypeParameter(typeParameterDescriptor);
if (scopeForTypeParameter instanceof ErrorUtils.ErrorScope) {
result[0] = ErrorUtils.createErrorType("?");
} else {
result[0] = new JetTypeImpl(
annotations,
typeParameterDescriptor.getTypeConstructor(),
nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor),
Collections.<TypeProjection>emptyList(),
scopeForTypeParameter
);
}
resolveTypeProjections(scope, ErrorUtils.createErrorType("No type").getConstructor(), type.getTypeArguments());
}