diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cir/utils.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cir/utils.kt index 41c625af6c8..27ee55c7512 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cir/utils.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cir/utils.kt @@ -90,17 +90,9 @@ internal fun CirClassOrTypeAliasType.withParentArguments( val newIsMarkedNullable = isMarkedNullable || parentIsMarkedNullable val newArguments = arguments.map { oldArgument -> - if (oldArgument is CirRegularTypeProjection) { - val oldArgumentType = oldArgument.type - if (oldArgumentType is CirTypeParameterType) { - when (val parentArgument = parentArguments[oldArgumentType.index]) { - is CirRegularTypeProjection -> if (parentArgument is CirClassOrTypeAliasType) return@map parentArgument - is CirStarTypeProjection -> return@map parentArgument - } - return@map parentArguments[oldArgumentType.index] - } - } - oldArgument + if (oldArgument !is CirRegularTypeProjection) return@map oldArgument + if (oldArgument.type !is CirTypeParameterType) return@map oldArgument + parentArguments[oldArgument.type.index] } return when (val newUnderlyingType = makeNullableIfNecessary(newIsMarkedNullable).withArguments(newArguments)) {