From e8845c29fe38e00927063cf9ffa1fe4e9f3e0c97 Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Tue, 28 Jul 2020 10:23:46 +0500 Subject: [PATCH] [IR] Used attributes instead of a hack to get original function --- .../kotlin/backend/konan/lower/CallableReferenceLowering.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt index 8c2dbb3082f..59aa6fd0790 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt @@ -284,8 +284,7 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass } +irDelegatingConstructorCall(superConstructor).apply applyIrDelegationConstructorCall@ { if (!isKFunction && !isKSuspendFunction) return@applyIrDelegationConstructorCall - // TODO: Remove as soon as IR declarations have their originalDescriptor. - val name = (referencedFunction.descriptor as? WrappedSimpleFunctionDescriptor)?.originalDescriptor?.name + val name = ((referencedFunction as? IrSimpleFunction)?.attributeOwnerId as? IrSimpleFunction)?.name ?: referencedFunction.name putValueArgument(0, irString(name.asString())) putValueArgument(1, irString((functionReference.symbol.owner).fullName))