Commit Graph

1960 Commits

Author SHA1 Message Date
eugene.levenetc f7f779df53 [ObjCExport] Add inner classes translation
KT-66339
2024-03-13 08:10:21 +00:00
Vladimir Sukharev 5fee662223 [Tests] Add test for KT-57391
^KT-57391
2024-03-12 18:10:10 +00:00
Dmitry Savvinov 08dc7aeee3 [native] Minor: remove PlatformManager.Serialized.serialVersionUUID
Leave a comment why it doesn't matter
2024-03-12 16:22:27 +00:00
Dmitry Savvinov b19ad2505c [native] Remove code support for experimental KonanTargets
ZEPHYR was the first and the last experimental KonanTarget.
As ZEPHYR is now entirely removed from the codebase, the respective code
can be dropped

^KT-64517
2024-03-12 16:22:27 +00:00
Dmitry Savvinov 53cbeb8edc [build, native] Adjust buildscripts after dropping K/N targets (6/8)
- Restore PlatformManager constructor (used in buildscripts)
- Replace references to deprecated K/N target with 'else'

Why: buildscripts use these references and compile against older K/N
version (from bootstrap). So they can't be adjusted to newer API,
compilation will fail right away. However, they can't be kept without
changes, because bootstrap tests will fail.

^KT-64517
^KT-66500
2024-03-12 16:22:27 +00:00
Dmitry Savvinov 8f3c0e71fa [native] Drop deprecated Kotlin/Native targets (5/8)
Adjust KGP: drop usages of deprecated KonanTargets, leave
@Deprecated-stubs in public APIs for readable errors

^KT-64517
2024-03-12 16:22:27 +00:00
Dmitry Savvinov 29e90d70c6 [native] Drop deprecated Kotlin/Native targets (3/8)
This commit inlines some helper-APIs that became redundant after
dropping deprecated targets.

Full list:
- 'threadsAreAllowed' is always 'true' now
- 'indirectBranchesAreAllowed' is always 'true' now
- 'supportsThreads' is always 'true' now
- 'isMips' is always 'false' now
- 'tlsMode' is always 'LLVMGeneralDynamicTLSModel' now
- 'getBoxRange' is always equal to 'cache.defaultRange' now
-  `targetHasAddressDependency` is always true now, so memory order
   is always LLVMAtomicOrderingMonotonic now

^KT-64517
2024-03-12 16:22:27 +00:00
Dmitry Savvinov 85bcc8443d [native] Drop deprecated Kotlin/Native targets (2/8)
Remove plain references to removed KonanTarget or Family entries. All
the changes in this commit are simple removal of some when-branches
on now dropped entries

^KT-64517
2024-03-12 16:22:26 +00:00
Dmitry Savvinov 0f05ffe111 [native] Drop deprecated Kotlin/Native targets (1/8)
Remove sealed subclasses in KonanTarget and associated entries in
Family. This commit doesn't adjust use-sites in the codebase,
see the following commits for that

Implementation notes:
- we use @Deprecated object-stubs in place of previously used sealed
subclasses/enum entries to report readable error instead of plain
UNRESOLVED_REFERENCE on usages of deprecated FQNs.

- these object-stubs *are not* part of the respective sealed
hierarchy/enum class. This is to make it possible to remove
references to them from use-site entirely without breaking exhaustive
'when's

^KT-64517 Fixed
2024-03-12 16:22:26 +00:00
Alexander Shabalin 8c6966765b [K/N][tests] Move driver tests into their own project ^KT-61259 2024-03-12 15:42:06 +00:00
Alexander Shabalin 316614bc9e Revert "Revert "[K/N][Tests] Ignore KonanDriverTest tests on MinGW/opt.debug/cache.no""
This reverts commit 876be8f17a.
2024-03-12 15:42:06 +00:00
Alexander Shabalin 9832edddab Revert "Revert "[K/N][Tests] Migrate test override_konan_properties0 and add testDriverVersion""
This reverts commit 8518c3f54f.
2024-03-12 15:42:06 +00:00
Alexander Shabalin 60c74ab91a Revert "Revert "[K/N][Tests] Migrate test override_konan_properties0""
This reverts commit 4765cfda53.
2024-03-12 15:42:06 +00:00
Alexander Shabalin 3c097ee5e0 Revert "Revert "[K/N][Tests] Migrate driver test llvm_variant_dev""
This reverts commit dc4f12f29c.
2024-03-12 15:42:06 +00:00
Igor Yakovlev 7c16528560 [Wasm] PL tests implementation for Wasm target
Fixed #KT-58088
2024-03-12 14:36:45 +00:00
Pavel Punegov 84e1ab1663 [K/N] XCTest support build script fix
Fix XCTest destination in the cinterop setup.
`-iframework` should point to the directory containing the framework.


Co-authored-by: Cristian Garcia <Cristian.Garcia-Marin@jetbrains.com>

Merge-request: KT-MR-14804
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2024-03-12 13:24:30 +00:00
eugene.levenetc aaea1d6af2 [ObjCExport] Fix interface implementing interface
KT-66380
2024-03-12 12:48:15 +00:00
Dmitrii Krasnov f18d00e6f0 [Gradle] Changed the way of unpacking k/n dependencies
Creating `tar` process is not supported by configuration cache.
Inner Gradle copy and archive operations don't work well with symlinks.
That is why we are using utils from org.apache.commons:commons-compress.

^KT-66422 Fixed
2024-03-12 11:55:13 +00:00
Ivan Kylchik e1180adfbd [Native] Always cast expression to the expected type after inline
Right now, during the process of inlining, the compiler erases types.
Because of that, we can end up with some random type
(for example, `Any`) where the concrete type was
expected (for example, `Int`). Compiler must insert a cast in the
required places.

#KT-66017 Fixed
2024-03-12 08:19:50 +00:00
Dmitriy Novozhilov 7a383373b0 [Test] Reproduce KT-65415 and KT-66432 2024-03-12 06:46:09 +00:00
Dmitriy Novozhilov d352cc9d96 [Frontend] Make DiagnosticSuppressor a project-level extension
Originally it was an application-level component, which caused non-trivial
  logic and cognitive load to carefully handle those extensions to avoid
  memory leaks.

6740a596 introduced a way to easily register `DiagnosticSuppressor` to
  project, and this commit continues this work, making it a proper
  project-level extension

A lot of changes caused by the fact, that this extension is needed to be
  obtained from `BindingContext` (see `BindingContextSuppressCache` and
  its usages), so almost all changes are introducing `Project` to
  `BindingContext`

^KT-66449 Fixed
2024-03-12 06:43:58 +00:00
Artem Daugel-Dauge 9e7e44e58f [Native] Add comments for the Xcode 15.3 workaround
^KT-65542
2024-03-11 13:25:40 +00:00
Alexander Shabalin aee87468a6 [K/N][tests] Move stress tests into a separate project 2024-03-07 15:01:30 +00:00
eugene.levenetc 0a7839a29a [ObjCExport] Fix primary constructor parameter annotation translation
KT-66401
2024-03-07 14:21:03 +00:00
Dmitriy Novozhilov 4b5eac7816 [Test] Add regression tests for issues which are fixed in K2
Related issues:
KT-10879, KT-18055, KT-20617, KT-23873
KT-25668, KT-31191, KT-33108, KT-41013
KT-51827, KT-53886, KT-56624, KT-58447
KT-58458, KT-58751, KT-58814, KT-60597
KT-62806, KT-63258, KT-63444, KT-65101
KT-65408, KT-65844, KT-66186

^KT-65926 Fixed
2024-03-07 12:49:47 +00:00
Dmitriy Novozhilov b875ae774e [FIR] Unwrap captured types in target type of SAM conversion
^KT-66256 Fixed
2024-03-07 12:41:05 +00:00
Vladimir Sukharev a9af52c288 [Tests] Add test for KT-44199
^KT-44199 Fixed
2024-03-07 11:36:49 +00:00
eugene.levenetc 16d53a0e34 [ObjCExport] Fix kdoc primary constructor
KT-66387
2024-03-07 10:32:36 +00:00
Sebastian Sellmair 10cf97f05b [ObjCExport] Support exported library modules
This new module gives the ability to resolve symbols
from provided klib KtLibraryModules withing a Analysis Session.

^KT-65327 Fixed
2024-03-07 09:23:37 +00:00
Sebastian Sellmair b5b7e5f262 [aa-klib-reader] Implement 'analysis-api-klib-reader' for swift- and objc export
This new module gives the ability to resolve symbols
from provided klib KtLibraryModules withing a Analysis Session.

^KT-65327 Fixed
2024-03-07 09:23:37 +00:00
Vladimir Sukharev b4bc576d37 [Tests] Add test for kt33411
^KT-33411 Fixed


Merge-request: KT-MR-14782
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2024-03-07 08:46:05 +00:00
Yan Zhulanow 507ab1e619 [Pill] Enable Pill for Swift export modules 2024-03-07 06:25:00 +00:00
Svyatoslav Scherbina b4c2164837 [K/N][tests] Fix kt42208WithPassingLambdaToAnotherFunction.kt for K2
It seems that K2 doesn't support `UnitConversionsOnArbitraryExpressions`
experimental language feature (KT-56011), while the test accidentally
relied on it.

Improve the test code so that it doesn't need this language feature
anymore, and enable the test for K2.

^KT-65553 Fixed
2024-03-06 17:07:27 +00:00
Denis.Zharkov b7129f78a3 K2: Fix IAE at Candidate.updateSourcesOfReceivers inside PCLA lambda
Previously, it was failing at line
(resolvedReceiver?.toReference(session) as? FirNamedReferenceWithCandidate)?.candidate?.updateSourcesOfReceivers()

But this line was mostly incorrect because in case of `a.b()` call,
which is resolved to `a.b.invoke()`, `resolvedReceiver` is pointing to
`a` instead of obviously expected `a.b`.

The fix with using `candidate.callInfo.explicitReceiver` doesn't help
either because the candidate of that receiver is always completed at
that stage (so no Candidate there).

The only case when the candidate was still there is PCLA because
 in that case we explicitly don't fully complete even receiver
expressions.
(see docs/fir/pcla.md)

The idea of the fix is moving the call of `updateSourcesOfReceivers`
for invoke property receiver to the place just before the candidate
is being converted to the resolved reference
(i.e., the candidate is being lost)

^KT-66148 Fixed
2024-03-06 17:01:57 +00:00
Sergej Jaskiewicz 67afd12f94 [test] Remove redundant signature clash diagnotic test from Native tests
Since d8d8f24f62 the tests for this
diagnostic are run with the Compiler Core test infrastructure
(see `compiler/testData/diagnostics/klibSerializationTests`)
There is no need to test it separately in `FirCompilerOutputTest`.

^KT-64393 Fixed
2024-03-06 16:05:40 +00:00
Artem Olkov a26ffe360c KT-65907: add handling for nested classes #KT-65907 fixed 2024-03-06 14:40:17 +00:00
Pavel Punegov 8ef2d49ab0 [K/N][test] Refactor test results handling
Move handling to appropriate TestRunCheck instances to make
them separate from each other. Also this makes it possible to
use separately from the ResultHandler on specific scenarios like
in FrameworkTest.
2024-03-06 13:32:32 +00:00
Pavel Punegov 5ddfd4fd91 [K/N][test] Check test filtering with different run parameters
Adds additional checks when different test filtering is used, like
ignored tests filter.
This makes SharedExecutionBuilder be able to handle tests separately
but run together in the executable.
2024-03-06 13:32:32 +00:00
Pavel Punegov 8907885a75 [K/N][test] Refactor test run checking
Make test filtering matching be a check instead of the verification
code in ResultHandler. This allows turning it on/off for specific
test cases and have different checking strategies.
2024-03-06 13:32:32 +00:00
Mikhail Glukhikh 5ea6f20192 K1/K2: add reproducers for KT-66229, KT-66243 and KT-66272
As all these issues aren't reproducible in K2, we may count them as fixed.
Related to KT-53478
#KT-66229 Fixed
#KT-66243 Fixed
#KT-66272 Fixed
2024-03-06 09:01:38 +00:00
Kirill Rakhman 4c93e9cff6 [FIR] Fix captured type arguments of local class as callable reference LHS
#KT-66267
2024-03-06 08:22:42 +00:00
eugene.levenetc 1f49e01f1a [ObjCExport] Add suspend function and @Throws tests
KT-66115, KT-66239
2024-03-05 22:52:17 +00:00
eugene.levenetc ac1f664a65 [ObjCExport] Add extras to ObjCExportStub for proper @Throws translation
KT-66239
2024-03-05 22:52:17 +00:00
eugene.levenetc 42d8db1c52 [ObjCExport] Fix suspend function and @Throws translations
KT-66115, KT-66239
2024-03-05 22:52:17 +00:00
Alexander Shabalin e8202c3355 [K/N] Simplify dependencies around kotlin-native/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin 24ede14e37 [K/N] Convert :kotlin-native:backend.native buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin 0542b62430 [K/N] Extract :native:cli-native from kotlin-native/backend.native/cli.bc 2024-03-05 21:47:43 +00:00
Kirill Rakhman 69a7bf7f68 [FIR] Add equality constraint from expected type for some synthetic function calls
This fixes some cases where we infer some type variable inside one
of the branches to Nothing instead of the expected type because Nothing
appeared in some other branch.

Specifically, we add an equality instead of a subtype constraint during
completion of calls to synthetic functions for if/when, try and !!.
We don't do it when the call contains a (possibly nested) elvis or is
inside the RHS of an assignment.
Otherwise, we would prevent some smart-casts.

#KT-65882 Fixed
2024-03-05 17:38:59 +00:00
eugene.levenetc 5c64832c0f [ObjCExport] Fix extensions interface name
KT-66315
2024-03-05 13:38:36 +00:00
Wojciech Litewka eec14f0054 [tree generator] Remove Suppress("unused") from implementation classes
Those only implement base classes, their members are not supposed
to be referenced directly (those sometimes they are).
So unused code in there can be suspicious.

On the other hand, some generated builders are truly unused, so leave
the suppression for them.
2024-03-05 13:06:03 +00:00