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); trace.record(BindingContext.REFERENCE_TARGET, referenceExpression, typeParameterDescriptor);
result[0] = new JetTypeImpl( JetScope scopeForTypeParameter = getScopeForTypeParameter(typeParameterDescriptor);
annotations, if (scopeForTypeParameter instanceof ErrorUtils.ErrorScope) {
typeParameterDescriptor.getTypeConstructor(), result[0] = ErrorUtils.createErrorType("?");
nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor), } else {
Collections.<TypeProjection>emptyList(), result[0] = new JetTypeImpl(
getScopeForTypeParameter(typeParameterDescriptor) annotations,
); typeParameterDescriptor.getTypeConstructor(),
nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor),
Collections.<TypeProjection>emptyList(),
scopeForTypeParameter
);
}
resolveTypeProjections(scope, ErrorUtils.createErrorType("No type").getConstructor(), type.getTypeArguments()); resolveTypeProjections(scope, ErrorUtils.createErrorType("No type").getConstructor(), type.getTypeArguments());
} }