Avoid a cycle of analysing of type parameters via checking that it's a type parameter first

This commit is contained in:
Victor Petukhov
2020-12-08 12:53:21 +03:00
parent a89329e077
commit 6f64e2c036
@@ -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()