Commit Graph

27 Commits

Author SHA1 Message Date
Pavel Kunyavskiy 6e8a7d4662 [ObjCInterop] Implement @ObjCSignatureOverride
This annotation leads to conflicting overloads error supression,
in case where several function with the same argument types,
but different argument names are inherited from ObjC class.

We need to implement it in both K1 and K2 to make the IDE experience
better.
But the annotation itself wouldn't be available in K1.

    ^KT-61323
2024-02-14 11:44:01 +00:00
Svyatoslav Scherbina 2e5a9b1416 [K/N] Make cinterop include unused Objective-C forward declarations
Previously, when an Objective-C library had an unused Objective-C
forward declaration (`@class` or `@protocol`), cinterop tool didn't
include it into the resulting klib at all.

This led to a subtle bug (KT-64105). One Obj-C library has unused
Obj-C forward declaration, and another one depends on the first and
uses this forward declaration, e.g. as a function result type.
When building the first cinterop klib, this forward declaration is not
added to `includedForwardDeclarations` in the klib manifest (the
compiler uses this property to decide whether to synthesize the
corresponding class).
When building the second cinterop klib, the forward declaration is not
added to its manifest either, because it is located in the dependency
(and therefore should've been included there).
As a result, the forward declaration is included nowhere, and any
attempt to use it in Kotlin fails, including calling the function from
the second lib.

This commit fixes this bug by including even unused Objective-C forward
declarations, which is consistent with any other kind of declarations
and seems more natural.

^KT-64105 Fixed
2024-01-25 14:06:10 +00:00
Vladimir Sukharev e958e57c42 [K/N][Tests] Migrate test forwardDeclarationsCast.kt
^KT-61259
2024-01-22 12:29:57 +00:00
Vladimir Sukharev 2f3705f0eb [K/N][Tests] Move funptr.kt to standalone tests due to OUTPUT_DATA_FILE directive
^KT-61259
2024-01-22 12:29:57 +00:00
Vladimir Sukharev c286b0efd7 [K/N][Tests] Migrate tests forwardDeclarationsTwoLibs.kt
^KT-61259
2024-01-22 12:29:57 +00:00
Vladimir Sukharev bd688b3ef7 [K/N][Tests] Migrate tests kt49034*.kt
^KT-61259
2024-01-22 12:29:57 +00:00
Vladimir Sukharev d2b810c373 [K/N][Tests] Polish sharing_with_weak.kt
^KT-61259
2024-01-19 18:37:43 +01:00
Vladimir Sukharev 39e2187d31 [K/N][Tests] Split filecheck part from test direct.kt
^KT-61259
2024-01-19 18:31:25 +01:00
Vladimir Sukharev 833e125450 [K/N][Tests] Polish test sharing_with_weak.kt
^KT-61259
2024-01-19 18:22:22 +01:00
Vladimir Sukharev 4aa8774c6e [K/N][Tests] Migrate test direct.kt
^KT-61259
2024-01-19 18:22:22 +01:00
Vladimir Sukharev e59a80bd69 [K/N][Tests] Migrate test overridabilityCondition.kt
^KT-61259
2024-01-19 18:22:21 +01:00
Vladimir Sukharev 2d0009ff99 [K/N][Tests] Migrate test illegal_sharing_with_weak.kt
^KT-61259
2024-01-19 18:22:21 +01:00
Vladimir Sukharev 647a907204 [K/N][Tests] Migrate kt48816 tests
^KT-61259
2024-01-19 18:22:21 +01:00
Vladimir Sukharev cc13888dd0 [K/N][Tests] Migrate second ObjC test with framework
^KT-61259
2024-01-19 18:22:21 +01:00
Vladimir Sukharev 1b18f4ed1e [K/N][Tests] Migrate first ObjC test with framework
^KT-61259
2024-01-19 18:22:20 +01:00
Vladimir Sukharev 6e2df0e086 [K/N][Tests] Migrate first Apple-specific test
^KT-61259
2024-01-19 18:22:20 +01:00
Vladimir Sukharev 48df87f635 [K/N][Tests] Migrate two more cinterop tests
^KT-61259
2024-01-17 08:33:41 +00:00
Vladimir Sukharev 80cf88c9b9 [K/N][Tests] Move threadStates tests to common codegen/box folder
^KT-61259
2024-01-16 20:15:25 +00:00
Vladimir Sukharev be9805ea5e [K2/N][Tests] Add test to demonstrate compiler behavior for ObjC properties intersection overrides
^KT-57640
2024-01-16 13:40:51 +00:00
Vladimir Sukharev 5f51f5e1fc [K/N] Migrate more cinterop tests
^KT-61259
2024-01-16 11:58:31 +00:00
Vladimir Sukharev e7e825a6b9 [K/N][tests] Split test structAnonym.kt
^KT-61259
2024-01-11 23:30:07 +00:00
Vladimir Sukharev 2ec8e8cf63 [K/N][tests] Use own reference implementation of availableProcessors()
^KT-61259
2024-01-11 23:30:07 +00:00
Vladimir Sukharev 9f2558f640 [K/N][Tests] Patch package names also for .def files
To separate interop modules to different packages,
.def files should be treated similarly to .kt files:
1) package directive should be prepended with test-specific synthetic package,
or, if, absent, package directive with synthetic package should be added.
2) in .kt files, import directives and fully-qualified import from interop modules
should be prepended with same test-specific synthetic package.
2024-01-11 23:30:07 +00:00
Vladimir Sukharev bf01cb16b4 [K/N][Tests] Migrate some cinterop tests to new infra
^KT-61259
2024-01-11 23:30:06 +00:00
Vladimir Sukharev b1508a49ac [K/N] Add failed test for KT-63049
^KT-63049
2023-12-19 09:15:39 +00:00
Vladimir Sukharev 089b7f31b5 [K/N] Fix indents
^KT-61259
2023-12-18 18:04:27 +00:00
Vladimir Sukharev c09e8909d4 [K/N] Move cinterop tests from standalone to codegen/box
^KT-61259
2023-12-18 18:04:27 +00:00