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 3a48f0f485f..b967b0cb4b0 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 @@ -192,6 +192,11 @@ class ExpressionCodegen( } else { (callable as CallableMethod).genInvokeDefaultInstruction(mv) } + val returnType = expression.descriptor.returnType + if (returnType != null && KotlinBuiltIns.isNothing(returnType)) { + mv.aconst(null) + mv.athrow() + } return StackValue.onStack(callable.returnType) } }