diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt index 16815bbc326..294b5067a17 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/DeepCopyIrTreeWithDescriptoros.kt @@ -271,7 +271,7 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val if (irCall !is IrCallImpl) return irCall // TODO what other kinds of call can we meet? val oldDescriptor = irCall.descriptor - val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor, + val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor.original, oldDescriptor) as FunctionDescriptor val oldSuperQualifier = irCall.superQualifier diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt index 02d4ce1248a..1de6934c4a4 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt @@ -85,9 +85,6 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid( override fun visitCall(expression: IrCall): IrExpression { - val fqName = currentFile!!.packageFragmentDescriptor.fqName.asString() // TODO to be removed after stdlib compilation - if(fqName.contains("kotlin")) return super.visitCall(expression) // TODO to be removed after stdlib compilation - val irCall = super.visitCall(expression) as IrCall val functionDescriptor = irCall.descriptor as FunctionDescriptor @@ -271,7 +268,8 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid( val operandTypeDescriptor = newExpression.typeOperand.constructor.declarationDescriptor if (operandTypeDescriptor !is TypeParameterDescriptor) return newExpression // It is not TypeParameter - do nothing - var typeNew = typeArgsMap[operandTypeDescriptor]!! + var typeNew = typeArgsMap[operandTypeDescriptor] + ?: return expression if (newExpression.typeOperand.isMarkedNullable) typeNew = typeNew.makeNullable() val startOffset = newExpression.startOffset