[JVM IR] Fix issue with suspend functions in @JvmMultifileClass.

This commit is contained in:
Mark Punzalan
2020-01-29 14:21:09 -08:00
committed by Alexander Udalov
parent 764bf1cb32
commit bc9edea527
2 changed files with 2 additions and 4 deletions
@@ -142,6 +142,8 @@ open class FunctionCodegen(
origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA &&
// This is just a template for inliner
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
parentAsClass.functions.none {
it.name.asString() == name.asString() + SUSPEND_IMPL_NAME_SUFFIX &&
@@ -4,10 +4,6 @@
// COMMON_COROUTINES_TEST
// 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:JvmMultifileClass