Box inline class returned from suspend lambda non-locally in JVM_IR

#KT-41194 Fixed
This commit is contained in:
Ilmir Usmanov
2020-10-16 18:22:13 +02:00
parent 70a4ed3ebc
commit 819d64a2ef
2 changed files with 5 additions and 2 deletions
@@ -827,6 +827,10 @@ class ExpressionCodegen(
}
val afterReturnLabel = Label()
expression.value.accept(this, data).materializeAt(returnType, returnIrType)
// In case of non-local return from suspend lambda 'materializeAt' does not box return value, box it manually.
if (isNonLocalReturn && owner.isInvokeSuspendOfLambda() && expression.value.type.isKotlinResult()) {
StackValue.boxInlineClass(expression.value.type.toIrBasedKotlinType(), mv)
}
generateFinallyBlocksIfNeeded(returnType, afterReturnLabel, data)
expression.markLineNumber(startOffset = true)
if (isNonLocalReturn) {
@@ -1,6 +1,5 @@
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR, JS_IR
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
import kotlin.coroutines.*