From 9ab053a3a6f970f08f9d941bc3a78b2472901b26 Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Tue, 15 Aug 2023 14:45:00 +0200 Subject: [PATCH] [Native] Drop `substitute` from `IrUtils2` We can reuse the same function from common `IrTypeUtils` --- .../org/jetbrains/kotlin/ir/util/IrUtils2.kt | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt index 3cc0fe84734..c2c083d3fa1 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUtils2.kt @@ -133,28 +133,6 @@ fun IrFunctionAccessExpression.addArguments(args: Map): IrType { - if (this !is IrSimpleType) return this - - return when (val classifier = this.classifier) { - is IrTypeParameterSymbol -> - map[classifier]?.mergeNullability(this) ?: this - is IrClassSymbol -> if (this.arguments.isEmpty()) { - this // Fast path. - } else { - val newArguments = this.arguments.map { - when (it) { - is IrTypeProjection -> makeTypeProjection(it.type.substitute(map), it.variance) - is IrStarProjection -> it - } - } - IrSimpleTypeImpl(classifier, nullability, newArguments, annotations) - } - is IrScriptSymbol -> classifier.unexpectedSymbolKind() - } - -} - private fun IrFunction.substitutedReturnType(typeArguments: List): IrType { val unsubstituted = this.returnType if (typeArguments.isEmpty()) return unsubstituted // Fast path.