From f887dcb79ac44372bcd6c89fe4528209c7eb1b36 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 28 Jan 2021 16:09:44 +0100 Subject: [PATCH] [interop][c][reverse] drop extensions check in function generator (KT-36639) - Initially this check was done with assumption that extension function couldn't be overrided --- .../src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt index 1c2a88efdb8..5e74fb8b6c3 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt @@ -214,7 +214,7 @@ private class ExportedElement(val kind: ElementKind, cname = "_konan_function_${owner.nextFunctionIndex()}" val llvmFunction = owner.codegen.llvmFunction(irFunction) // If function is virtual, we need to resolve receiver properly. - val bridge = if (!DescriptorUtils.isTopLevelDeclaration(function) && !function.isExtension && + val bridge = if (!DescriptorUtils.isTopLevelDeclaration(function) && irFunction.isOverridable) { // We need LLVMGetElementType() as otherwise type is function pointer. generateFunction(owner.codegen, LLVMGetElementType(llvmFunction.type)!!, cname) {