diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt index d0e29f27f93..c08270bdd90 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/objcexport/ObjCExportNamer.kt @@ -407,7 +407,8 @@ private fun ObjCExportMapper.canBeInheritedBySameClass( second: CallableMemberDescriptor ): Boolean { if (this.isTopLevel(first) || this.isTopLevel(second)) { - return (first.containingDeclaration.fqNameSafe == second.containingDeclaration.fqNameSafe) + return this.isTopLevel(first) && this.isTopLevel(second) && + first.source.containingFile == second.source.containingFile } val firstClass = this.getClassIfCategory(first) ?: first.containingDeclaration as ClassDescriptor