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 5c41d1a313e..5e14d853522 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 @@ -37,10 +37,10 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid( val copyFuncDeclaration = functionDeclaration.accept(DeepCopyIrTree(), null) as IrFunction // Create copy of the function. val body = copyFuncDeclaration.body!! as IrBlockBody - val statements = removeReturn(body.statements) // Replace "return" with its value. val startOffset = copyFuncDeclaration.startOffset val endOffset = copyFuncDeclaration.endOffset val returnType = copyFuncDeclaration.descriptor.returnType!! + val statements = body.statements val irBlock = IrBlockImpl(startOffset, endOffset, returnType, null, statements) // Create IrBlock containing function statements. val parameterToExpression = expression.getArguments() // Build map parameter -> expression. @@ -63,6 +63,14 @@ internal class ParametersTransformer(val parameterToExpression: List