fix attempt to create JetTypeImpl with ErrorScope
ErrorScope is created here if any typeParameterDescriptor upper bounds scope is ErrorScope
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user