Compute nullability for stub types properly

This commit is contained in:
Victor Petukhov
2021-05-11 17:17:37 +03:00
parent afbda75581
commit ee927a15a9
@@ -303,6 +303,11 @@ public class TypeUtils {
if (isTypeParameter(type)) {
return hasNullableSuperType(type);
}
if (type instanceof AbstractStubType) {
NewTypeVariableConstructor typeVariableConstructor = (NewTypeVariableConstructor) ((AbstractStubType) type).getOriginalTypeVariable();
TypeParameterDescriptor typeParameter = typeVariableConstructor.getOriginalTypeParameter();
return typeParameter == null || hasNullableSuperType(typeParameter.getDefaultType());
}
TypeConstructor constructor = type.getConstructor();
if (constructor instanceof IntersectionTypeConstructor) {