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 30dad251315..b080bdd62b2 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 @@ -425,7 +425,7 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: DeclarationDe return IrCallableReferenceImpl( startOffset = expression.startOffset, endOffset = expression.endOffset, - type = newDescriptor.returnType!!, + type = expression.type, descriptor = newDescriptor, typeArguments = expression.getTypeArgumentsMap(), origin = mapStatementOrigin(expression.origin) 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 9221c018e0f..2e47a70c7b2 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 @@ -217,6 +217,7 @@ private class Inliner(val currentScope: ScopeWithIr, val context: Context) { private fun argumentNeedsEvaluation(expression: IrExpression): Boolean { if (expression is IrGetValue) return false // Parameter is already GetValue - nothing to evaluate. if (expression is IrConst<*>) return false // Parameter is constant - nothing to evaluate. + if (expression is IrCallableReference) return false // Parameter is callable reference - nothing to evaluate. if (isLambdaExpression(expression)) return false // Parameter is lambda - will be inlined. return true }