Commit Graph

107870 Commits

Author SHA1 Message Date
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
Denis.Zharkov 8f9c09482b K2: Fix inference from assignment in PCLA
Before this, the order of the constraints being added was incorrect

^KT-64222 Fixed
2024-01-11 13:35:13 +00:00
Denis.Zharkov 97d17012e5 K2: Add test reproducing KT-64222 2024-01-11 13:35:13 +00:00
Dmitriy Novozhilov dbbfb23fa9 [Build] Fix JPS build issue caused by :plugins:jso module 2024-01-11 12:48:34 +00:00
Sergej Jaskiewicz a0ba878b1d [FIR2IR] De-duplicate creation of Fir2IrConfiguration
This will help to prevent inconsistencies between creating
the configuration in the actual compiler pipeline and in compiler tests.
2024-01-11 12:16:54 +00:00
Dmitriy Novozhilov 4d4c95b643 [FIR] Extract part of FirNativeObjCNameChecker into a separate checker
There was a part of `FirNativeObjCNameChecker` which worked only with
  callable declarations, so it makes sense to extract it into the separate
  callable declarations-only checker. Also this separation will be useful
  in the future changes, when this checkers will be implemented differently
  for expect and non-expect classes in scope of KT-58881
2024-01-11 11:38:11 +00:00
Dmitriy Novozhilov 728f42d02a [FIR] Extract common utilities for ObjCName checkers
Previously there were cross-references between `FirNativeObjCNameChecker`
  and `FirNativeObjCNameOverridesChecker` checkers, which made the flow
  of code quite non-intuitive

This commit extracts common methods and classes used by them into separate
  `FirNativeObjCNameUtilities` object
2024-01-11 11:38:11 +00:00
Denis.Zharkov 72b0372927 K2: Allow PCLA inference when a value parameter has a TV type
^KT-64877 Fixed
2024-01-11 10:32:12 +00:00
Denis.Zharkov b2ca19da73 K2: Adjust test data after correcting source for it
While reporting a diagnostic there seems to be correct because the
parameter type is ConeErrorType, the former fact is a bug
in PCLA that should be fixed soon
2024-01-11 10:32:12 +00:00
Denis.Zharkov e359db4111 K2: Set proper source for implicit it/receiver parameter
Previously, error types on those implicit parameters were being lost.

Changed test data is only partly here
(only parts that are considered to be correct).

Other ones (new green-to-red changes) should belong to the next commit
and will be fixed soon (as a part of PCLA).
2024-01-11 10:32:12 +00:00