[JVM IR] Fix issue with suspend functions in @JvmMultifileClass.
This commit is contained in:
committed by
Alexander Udalov
parent
764bf1cb32
commit
bc9edea527
+2
@@ -142,6 +142,8 @@ open class FunctionCodegen(
|
|||||||
origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA &&
|
origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA &&
|
||||||
// This is just a template for inliner
|
// This is just a template for inliner
|
||||||
origin != JvmLoweredDeclarationOrigin.FOR_INLINE_STATE_MACHINE_TEMPLATE_CAPTURES_CROSSINLINE &&
|
origin != JvmLoweredDeclarationOrigin.FOR_INLINE_STATE_MACHINE_TEMPLATE_CAPTURES_CROSSINLINE &&
|
||||||
|
// This is just a bridge to the function with the continuation
|
||||||
|
origin != JvmLoweredDeclarationOrigin.MULTIFILE_BRIDGE &&
|
||||||
// Continuations are generated for suspendImpls
|
// Continuations are generated for suspendImpls
|
||||||
parentAsClass.functions.none {
|
parentAsClass.functions.none {
|
||||||
it.name.asString() == name.asString() + SUSPEND_IMPL_NAME_SUFFIX &&
|
it.name.asString() == name.asString() + SUSPEND_IMPL_NAME_SUFFIX &&
|
||||||
|
|||||||
-4
@@ -4,10 +4,6 @@
|
|||||||
// COMMON_COROUTINES_TEST
|
// COMMON_COROUTINES_TEST
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// When -Xmultifile-parts-inherit is disabled, JVM IR backend generates "bridges" that delegate into part members and puts them into
|
|
||||||
// the multifile facade. But since the multifile facade phase happens after coroutines, continuations are not created for suspend functions.
|
|
||||||
|
|
||||||
// FILE: test.kt
|
// FILE: test.kt
|
||||||
|
|
||||||
@file:JvmMultifileClass
|
@file:JvmMultifileClass
|
||||||
|
|||||||
Reference in New Issue
Block a user