JVM_IR: do not optimize suspend$$forInline functions

`$$forInline` functions do not pass through the state machine generator,
and optimizing `Ref`s before that changes how assignments inside lambdas
passed to `suspendCoroutine`, etc. behave: without a `Ref`, the
assignment is not reflected in the continuation object, so the variable
has old value on resumption.

These functions will be optimized later, after they are inlined
somewhere and the state machine is generated.

^KT-52198 Fixed
This commit is contained in:
pyos
2022-04-29 13:29:42 +02:00
committed by Ilmir Usmanov
parent 153f878df4
commit effd21d074
14 changed files with 109 additions and 7 deletions
@@ -33,7 +33,8 @@ enum class JvmDeclarationOriginKind {
AUGMENTED_BUILTIN_API,
ERASED_INLINE_CLASS,
UNBOX_METHOD_OF_INLINE_CLASS,
JVM_OVERLOADS
JVM_OVERLOADS,
INLINE_VERSION_OF_SUSPEND_FUN,
}
class JvmDeclarationOrigin(