Commit Graph

107885 Commits

Author SHA1 Message Date
Ilya Goncharov 84727f8d2b Upgrade yarn.lock 2024-01-12 17:04:54 +00:00
Denis.Zharkov 2db031d71e Drop unused createDeprecatedAnnotation
^KT-60858 Fixed
2024-01-12 16:59:42 +00:00
Andrey Yastrebov db27e29c08 fixup! KT-63592 Create setupLLDBScript task 2024-01-12 16:27:19 +00:00
Svyatoslav Scherbina 82f80a4899 Bump Kotlin/Native version in KGP to 2.0.0-dev-12398 2024-01-12 16:19:33 +00:00
Sergej Jaskiewicz 61e957fc00 [JS] Mute the EXPORTING_JS_NAME_CLASH_ES diagnostic in TS export tests
This diagnostic started to appear after
51c920af01e3d583c552224a529abe1f6e5fcf16.
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz eda30ff704 [klib] Implement diagnostics for clashing KLIB signatures
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`

For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""

fun foo(): Int = 0
```

the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
```

Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.

^KT-63670 Fixed
2024-01-12 15:59:28 +00:00
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