diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index a8f9789436a..3e841660a78 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -124,6 +124,9 @@ class ExpressionCodegen( //for implicit return mv.areturn(Type.VOID_TYPE) } + else if (irFunction.body is IrExpressionBody) { + mv.areturn(returnType) + } writeLocalVariablesInTable(info) mv.visitEnd() } @@ -367,6 +370,10 @@ class ExpressionCodegen( return expression.onStack } + override fun visitExpressionBody(body: IrExpressionBody, data: BlockInfo): StackValue { + return body.expression.accept(this, data) + } + override fun visitElement(element: IrElement, data: BlockInfo): StackValue { TODO("not implemented for $element") //To change body of created functions use File | Settings | File Templates. }