Box inline class returned from suspend lambda non-locally in JVM_IR
#KT-41194 Fixed
This commit is contained in:
+4
@@ -827,6 +827,10 @@ class ExpressionCodegen(
|
|||||||
}
|
}
|
||||||
val afterReturnLabel = Label()
|
val afterReturnLabel = Label()
|
||||||
expression.value.accept(this, data).materializeAt(returnType, returnIrType)
|
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)
|
generateFinallyBlocksIfNeeded(returnType, afterReturnLabel, data)
|
||||||
expression.markLineNumber(startOffset = true)
|
expression.markLineNumber(startOffset = true)
|
||||||
if (isNonLocalReturn) {
|
if (isNonLocalReturn) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
// IGNORE_BACKEND: JS_IR
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user