diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java index c60dc0756eb..c6b1d244c70 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java @@ -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) {