From c1b34a83e919b75e6e3a2b58b3ba4e7b4a6ffc04 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 19 Aug 2019 18:40:33 +0300 Subject: [PATCH] Fix enhancement behavior in case of error-typed upper bounds --- .../kotlin/load/java/typeEnhancement/signatureEnhancement.kt | 1 + 1 file changed, 1 insertion(+) 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