Native: fix location offsets in SuspendFunctionN implementations

When generating synthetic Function{N+1}.invoke implementations for
SuspendFunction{N} subclasses, use SYNTHETIC_OFFSET instead of
suspend invoke function location offsets.

This location is more suitable for generated synthetic functions.
Additionally, this fixes the case when suspend invoke is fake override:
fake overrides use UNDEFINED_OFFSET, so the generated function was
getting UNDEFINED_OFFSET as well, leading to incorrect debug
information.

Fix suspendFunctionAsSupertype.kt and suspendFunctionAsSupertypeCall.kt
This commit is contained in:
Svyatoslav Scherbina
2022-02-21 13:41:59 +03:00
committed by Space
parent 964edbaf91
commit 0c24f67c21
@@ -110,8 +110,8 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co
clazz.superTypes += functionType
context.irFactory.buildFun {
startOffset = invokeFunction.startOffset
endOffset = invokeFunction.endOffset
startOffset = SYNTHETIC_OFFSET
endOffset = SYNTHETIC_OFFSET
origin = DECLARATION_ORIGIN_COROUTINE_IMPL
name = OperatorNameConventions.INVOKE
visibility = DescriptorVisibilities.PROTECTED