Fix enhancement behavior in case of error-typed upper bounds

This commit is contained in:
Denis Zharkov
2019-08-19 18:40:33 +03:00
committed by Victor Petukhov
parent 2964d52640
commit c1b34a83e9
@@ -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