From bc9edea5279c6d5c70fbc3266f3a7dfc16b3a23e Mon Sep 17 00:00:00 2001 From: Mark Punzalan Date: Wed, 29 Jan 2020 14:21:09 -0800 Subject: [PATCH] [JVM IR] Fix issue with suspend functions in @JvmMultifileClass. --- .../jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt | 2 ++ .../coroutines/inlineFunctionInMultifileClassUnoptimized.kt | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt index 73321bd23ee..7b2bac4e682 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt @@ -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 && diff --git a/compiler/testData/codegen/box/coroutines/inlineFunctionInMultifileClassUnoptimized.kt b/compiler/testData/codegen/box/coroutines/inlineFunctionInMultifileClassUnoptimized.kt index 8900575d151..a6f04e3ce89 100644 --- a/compiler/testData/codegen/box/coroutines/inlineFunctionInMultifileClassUnoptimized.kt +++ b/compiler/testData/codegen/box/coroutines/inlineFunctionInMultifileClassUnoptimized.kt @@ -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