From 6f64e2c0360a8c760f188ac5286a3c117a7635ae Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Tue, 8 Dec 2020 12:53:21 +0300 Subject: [PATCH] Avoid a cycle of analysing of type parameters via checking that it's a type parameter first --- .../kotlin/load/java/typeEnhancement/typeEnhancement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt index faf4b9202a3..359a900e96b 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt @@ -238,7 +238,7 @@ internal class NotNullTypeParameter(override val delegate: SimpleType) : NotNull override fun substitutionResult(replacement: KotlinType): KotlinType { val unwrappedType = replacement.unwrap() - if (!TypeUtils.isNullableType(unwrappedType) && !unwrappedType.isTypeParameter()) return unwrappedType + if (!unwrappedType.isTypeParameter() && !TypeUtils.isNullableType(unwrappedType)) return unwrappedType return when (unwrappedType) { is SimpleType -> unwrappedType.prepareReplacement()