JVM_IR: assume function reference adapters are tail-call

Meaning, they never need continuation objects. This shouldn't affect
correctness (if the assumption is valid, the continuation object
should always have been removed in the end), but the phantom
continuation sometimes left behind unused accessors (and in case of
inline function references, those accessors would refer to non-existent
functions) - see the modified test and Kotlin/kotlinx.coroutines#2769.
This commit is contained in:
pyos
2021-06-17 09:40:04 +02:00
committed by Ilmir Usmanov
parent 635a0fb01c
commit 537ce05bc9
2 changed files with 2 additions and 1 deletions
@@ -151,6 +151,8 @@ private val BRIDGE_ORIGINS = setOf(
JvmLoweredDeclarationOrigin.SUPER_INTERFACE_METHOD_BRIDGE,
IrDeclarationOrigin.BRIDGE,
IrDeclarationOrigin.BRIDGE_SPECIAL,
IrDeclarationOrigin.ADAPTER_FOR_CALLABLE_REFERENCE,
IrDeclarationOrigin.ADAPTER_FOR_SUSPEND_CONVERSION
)
// These functions contain a single `suspend` tail call, the value of which should be returned as is