Commit Graph

109329 Commits

Author SHA1 Message Date
Sergej Jaskiewicz e0cb145c6b [JVM] Split JvmSignatureClashDetector into two classes
One for methods, one for fields.
Later we are going to use the new `SignatureClashDetector` class
for detecting clashes of KLIB signatures.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz e0f9e09a97 [JVM] Rename JvmSignatureClashDetector → JvmMethodSignatureClashDetector
This is to preserve the Git history of this file during the subsequent
refactoring.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz c800144025 [IR] Add a new method to the IrDiagnosticReporter interface 2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz 2cee4ddf5c [JS] Use IrDiagnosticReporter in place of its more specific subclass
To reuse this diagnostic reporter in `serialization.common` for
reporting signature clashes (KT-63670), we must extract it to
the `serializeModuleIntoKlib` method instead of creating it in
`JsKlibCheckers`.

However, because `serialization.common` does not depend on
the `backend.common` module in which
`KtDiagnosticReporterWithImplicitIrBasedContext` is declared,
we have to use the `IrDiagnosticReporter` interface in place of
`KtDiagnosticReporterWithImplicitIrBasedContext`.

Besides, it's better from the architectural point of view:
the users of that diagnostic reporter should not know about its
implementation details.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz 3430551681 [IR] Move IrElement#sourceElement to the ir.tree module
This is so that it could be used from more places.
Namely, we need to use it from the `serialization.common` module.
2024-01-12 15:59:28 +00:00
Sebastian Sellmair 9c3de4332f [ObjCExport] Run new ObjCExport tests as native tests on CI
^KT-64839 Fixed
2024-01-12 15:37:41 +00:00
Sebastian Sellmair 809b278a7b [Minor] Remove unnecessary backend.native/functionalTest/.editorconfig 2024-01-12 15:37:41 +00:00
Artem Kobzar de44905edd [Tests] Show all the missing artifacts in the ArtifactsTest instead of asserting one by one 2024-01-12 15:37:20 +00:00
Dmitriy Novozhilov 8300ad76d0 [FIR2IR] Remember overridden symbols if f/o contains error types
^KT-64837 Fixed
2024-01-12 15:32:25 +00:00
Roman Efremov 46cd5621bd [Test] Add test for two override-related diagnostics reported on one line
^KT-55433
2024-01-12 15:30:54 +00:00
Sergey Bogolepov 591e98a947 [KT-63275] Generate wrapper bodies in the SwiftExportExtension 2024-01-12 15:06:18 +00:00
Sergey Bogolepov cb19e291a3 [KT-63275] Implement trivial bodies in SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov 5dd1d7c9c1 [KT-63275] Add a nullable body property to SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov d54877be87 [KT-63275] Prepare SirAsSwiftSourcesPrinter for non-empty bodies 2024-01-12 15:06:18 +00:00
Alexander Shabalin 30550a6da1 [K/N] Immediately destroy objects that finalize only via ExtraObjectData ^KT-63423 2024-01-12 15:03:46 +00:00
Dmitriy Novozhilov 3c897ab20c [FIR2IR] Set opt-ins in FakeOverrideGenerator more granular 2024-01-12 15:01:49 +00:00
Dmitriy Novozhilov a11705186f [FIR2IR] Properly extract accessor symbols in FakeOverrideGenerator
^KT-64432 Fixed
2024-01-12 15:01:49 +00:00
Dmitriy Novozhilov 6dd0992288 [FIR2IR] Generate annotations on delegated property accessors
^KT-64466 Fixed
2024-01-12 15:01:33 +00:00
Dmitriy Novozhilov 50abaaff7e [Test] Reproduce KT-64466 2024-01-12 15:01:33 +00:00
Brian Norman be728d4291 [Lombok] Constructor can have only non-static fields
When using the AllArgsConstructor annotation (directly or via
meta-annotation), only fields that are not static should be added as
arguments. Previously, all fields were being included regardless of
static-ness, which is not consistent with the behavior of Lombok.

^KT-54025 Fixed
2024-01-12 14:55:24 +00:00
Brian Norman 2ab1e712f8 [Lombok] Constructor can have only non-final or not initialized fields
When using the AllArgsConstructor annotation (directly or via
meta-annotation), only fields that are not final or not initialized
should be added as arguments. Previously, all fields were being included
regardless of modality or initialization, which is not consistent with
the behavior of Lombok.

^KT-54054 Fixed
2024-01-12 14:55:24 +00:00
Nikolay Lunyak cf4c55e02d [FIR JS] Create an LT diagnostics with BE runner 2024-01-12 13:42:23 +00:00
Nikolay Lunyak ac8b39cbde [FIR JS] Remove weird source picking in FirJsExternalChecker
Otherwise, these tests fail due to
misplaced diagnostics in LT:
- `testExtensionFunctionArgumentOrReturnType`
- `testInlineClassAsParameterOrReturnType_allowed_kt`
- `testInlineClassAsParameterOrReturnType_kt`
2024-01-12 13:42:23 +00:00
Nikolay Lunyak 9370f42eda [FIR JS] Fix DEBUG_INFO_DYNAMIC positioning
Otherwise, it's reported for `d += 1`
instead of `+=`, but since we only
render `DEBUG_INFO_DYNAMIC` if there's
already one at exactly the same
location, we effectively just lose
some of the existing ones.
2024-01-12 13:42:23 +00:00
Nikolay Lunyak 8a4212f140 [FIR JS] Create an LT diagnostics runner 2024-01-12 13:42:23 +00:00
Nikolay Lunyak fa47950491 [FIR JS] Fix testPeculiarNames for LT
Before this change there's was
`NOT_A_LOOP_LABEL` for "break@`!`"
in `FirLightTreeJsBoxTestGenerated`
2024-01-12 13:42:23 +00:00
Nikolay Lunyak f7f5ac080f [FIR JS] Create an LT Box runner 2024-01-12 13:42:23 +00:00
Nikolay Lunyak 4b8b7aaa54 [FIR JS] Don't create secondary constructor calls for externals
The change in PSI consistency test is needed, because
we may sometimes observe empty
`KtConstructorDelegationCall`s, and we don't want
to build delegation calls for constructors of `external`
classes with such calls.

^KT-64548 Fixed
2024-01-12 13:42:23 +00:00
Nikolay Lunyak 9a598026c8 [FIR JS] Reproduce KT-64548
Running the FIR tests leads to the
crash.

^KT-64548
2024-01-12 13:42:23 +00:00
Dmitrii Gridin e60a436068 [PSI2FIR] add test on primary constructor without constructor keyword
^KT-64900
2024-01-12 12:19:54 +00:00
Dmitrii Gridin 2c0cf9cad8 [PSI2FIR] split AbstractRawFirBuilderLazyBodiesTestCase on ast and stub versions
This commit explicitly splits raw fir builder in lazy mode on
AST and stubs.
By default, in tests we have an AST tree loaded, so all our
`disallowTreeLoading` is useless in unit tests mode

^KT-64646 Fixed
^KT-64898
^KT-64899
^KT-64900
^KT-64901
2024-01-12 12:19:54 +00:00
Ilya Goncharov 459a8368a6 [Gradle, JS] NodeJsExec.create with KotlinJsCompilation left for kotlinx-benchmark compatibility
^KT-63714 fixed
2024-01-12 11:27:40 +00:00
Dmitriy Novozhilov f12b77c359 [Doc] Describe the process of introducing new TODOs in the codebase 2024-01-12 10:21:32 +00:00
Alejandro Serrano Mena b077293396 [FIR] Allow, but also warn, KMutableProperty with captured types
^KT-63589 Fixed
2024-01-12 10:07:14 +00:00
Sebastian Sellmair 80d9933543 [ObjCExport] Analysis Api: Implement initial support for exporting 'MustBeDocumented' annotations
^KT-64869 Fixed
2024-01-12 09:41:46 +00:00
anzhela.sukhanova cdcb3e4dcd Tests for KT-64640
Add generated test methods
2024-01-12 08:08:20 +00:00
anzhela.sukhanova 741c8eeba5 Tests for KT-64640
Add test for other collections with (add/remove)(First/Last) methods. Add test for LinkedHashMap.put(First/Last) methods (they are also appeared in Java 21)
2024-01-12 08:08:20 +00:00
Alexander Shabalin b7fbfb2fde [K/N][tests] Migrate first platform-dependent test to new testing infra
^KT-61259
2024-01-12 00:47:31 +01:00
Vladimir Sukharev 4786c945d9 [K/N][tests] Elaborate comment in CInteropPackagesTest.kt
^KT-61259
2024-01-11 23:30:07 +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 55a78bf499 [K/N][Tests] Migrate testData of KT59030WorkaroundTest to new new test infra 2024-01-11 23:30:06 +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
Sergej Jaskiewicz 422128f3dc [MPP] Fix a failing MPP diagnostic test
This test had the IGNORE_FIR2IR_EXCEPTIONS_IF_FIR_CONTAINS_ERRORS
directive enabled. This prevented some diagnostics from showing up
in this test, because there was this exception thrown in FIR2IR:

java.lang.IllegalStateException: IrSimpleFunctionPublicSymbolImpl for
/foo|foo(){}[0] is already bound:
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit

a0ba878b1d disabled the
`linkViaSignatures` flag in JS tests, which also fixed the exception.
Because of that, the full pipeline could be run, and the diagnostics
started to appear, which is the correct behavior.

Not that this only concerns _tests_, not production code, because
in the production pipeline `linkViaSignatures` had been disabled even
before that change.
2024-01-11 21:07:34 +00:00
eugene.levenetc a778c6d9aa [ObjCExport] Add initial top level function export
KT-64874
2024-01-11 18:25:38 +00:00
Yan Zhulanow e67042118a [Pill] Use the multi-platform kotlin-test library (see KT-61969)
Pill import broke after the 'kotlin-test' build refactoring
(now it's a proper KMP project). This change adapts source set handling
in Pill, providing support both for Java and Kotlin KMP source sets.
2024-01-11 16:44:59 +00:00
Yahor Berdnikau e2a06c66cc [Gradle] Fix warnings in KotlinCompilationSourceSetsContainerFactories
^KT-56904 In Progress
2024-01-11 16:32:43 +00:00
Nikita Bobko 60365cc116 Revert "Make it possible to enable "non-local break and continue" with -language-version flag"
This reverts commit 96b2f13397.

Unfortunately, in K2, the feature works only in JVM. KT-56466 The
feature is postponed till 2.2 (preview is postponed till 2.1)

KT-1436
2024-01-11 15:16:26 +00:00
Leonid Startsev 4c7a79f8b9 Provided changelog for kotlinx-metadata-jvm 0.9.0 2024-01-11 14:10:20 +00:00