diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt index 2da581ef364..ffc41886cf4 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt @@ -428,6 +428,7 @@ class SignatureEnhancement( // Do not use bounds from Kotlin-defined type parameters if (this !is LazyJavaTypeParameterDescriptor) return null return when { + upperBounds.all(KotlinType::isError) -> null upperBounds.all(KotlinType::isNullabilityFlexible) -> null upperBounds.any { !it.isNullable() } -> NullabilityQualifier.NOT_NULL else -> NullabilityQualifier.NULLABLE