Commit Graph

106528 Commits

Author SHA1 Message Date
Alexander.Likhachev 2bd77d5cdc [IGS] Add a non-interactive way to make a consent decision for IDEA builds
When running builds from IDEA, especially tests, the interactive consent request is barely noticeable. Also, some of the tools windows are non-interactive terminals. Thus, we detect the IDEA builds and fail fast to make it noticeable.
^KTI-1443 Fixed
2023-11-28 15:32:23 +00:00
Alexander.Likhachev ab5699f106 [IGS] Ask for consent only 5 times
^KTI-1443 In Progress
2023-11-28 15:32:23 +00:00
Alexander.Likhachev b0254add6d [Gradle] Add a check for the SNAPSHOT_SIZE metric 2023-11-28 15:22:43 +00:00
Alexander.Likhachev a7e3f7b3a6 [Gradle] Apply IDEA suggestions to BuildReportsIT.kt 2023-11-28 15:22:43 +00:00
Alexander.Likhachev 71320d2439 [IC] Add a check for the CACHE_DIRECTORY_SIZE metric
^KT-63010 Fixed
2023-11-28 15:22:43 +00:00
Alexander.Likhachev 06c1bcdc5d [IC] Add filter on files for the CACHE_DIRECTORY_SIZE metric
Without the filter, we were walking both through subdirectories and their files, so some files might be counted twice. Moreover, the behaviour of `File.length` is unspecified for directories.
^KT-63010 In Progress
2023-11-28 15:22:43 +00:00
Alexander.Likhachev 4eccbd75c3 [IC] Measure IC size metrics after the caches are closed
Before this fix, the size metrics were measured after the compilation is finished, but before the caches are closed. In many cases it might lead to incorrect measurements. After flipping the default value of the `keepIncrementalCompilationCachesInMemory` flag for Gradle builds, it started to cause always incorrect results.
^KT-63010 In Progress
2023-11-28 15:22:43 +00:00
Alexander.Likhachev 9f89e7f94f [Gradle] Flip the IC backup optimizations flags in the tests
^KT-62758 Fixed
2023-11-28 15:22:43 +00:00
Alexander.Likhachev 0f245ef3c6 [Gradle] Enable the IC backup optimizations by default
^KT-62758 In Progress
2023-11-28 15:22:43 +00:00
Alexander.Likhachev f0c643a887 [Gradle] Remove warning about experimental IC backup optimizations
This commit is part of the optimizations stabilization
^KT-62758 In Progress
2023-11-28 15:22:43 +00:00
Ilya Goncharov 093f51c89a [JS] Removing usage of legacy JS compiler #1 2023-11-28 13:44:37 +00:00
Leonid Startsev 662bff7351 Make $serializer generic constructor public
If a serializable class has generic type parameters, its serializer is not an object
and has a specialized constructor. This constructor was public in K1 and should
be public in K2 so it can be called from other serializable classes
(in case class is e.g., part of sealed hierarchy).

#KT-63402 Fixed
2023-11-28 13:31:08 +00:00
Leonid Startsev 51e3e9af94 Use a correct type for SERIALIZER_TYPE_INCOMPATIBLE diagnostic.
This diagnostic used an incorrect type for rendering (outer class type instead of a property type)
and didn't expand type argument of `KSerializer`.

Also add an additional test case for generic parameters.

#KT-63570 Fixed
2023-11-28 13:30:45 +00:00
Mikhail Glukhikh 1260d03561 Drop erroneous FirJavaConstructorBuilder.visibility
Related to KT-62961
2023-11-28 13:30:26 +00:00
Mikhail Glukhikh 2cea2b9098 K2/Java: add private enum constructor for MPP matching
#KT-62961 Fixed
2023-11-28 13:30:26 +00:00
Evgenii Mazhukin 563c878f20 [KGP] Fix sharing build cache between Windows and Linux
On Windows, path() uses backslash as a file separator, and Mac/Linux
are using forward slashes. If friendPathsSet differs, remote build outputs
from other platforms can't be reused.

This patch uses invariant paths to address the issue.

^KT-63460 Fixed


Merge-request: KT-MR-13261
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-11-28 12:09:39 +00:00
Evgeniy.Zhelenskiy 5258e2044d [FIR] Forbid annotations on anonymous initializers and destructuring declarations
#KT-59896


Merge-request: KT-MR-13197
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2023-11-28 11:59:26 +00:00
Svyatoslav Kuzmich e901629cf0 [Wasm] Support WASI target in K2
- Support WASI mode in CLI and test infrastructure
- Add external declaration checker
- Split Fir diagnostic lists into Base, JS and WASI

#KT-56849 Fixed
2023-11-28 11:51:53 +00:00
Artem Kobzar f26b0a5be6 [K/JS] Fix case with boxing/unboxing inside the BlockDecomposerLowering ^KT-63808 Fixed 2023-11-28 11:51:08 +00:00
Ilya Goncharov 8c95665e27 [Gradle, JS] Deprecate specific Node.js properties
^KT-62780 fixed
2023-11-28 10:36:36 +00:00
Igor Chevdar 1805f322f8 [K/N] Do not use LazyIr for per-file caches
#KT-63789 Fixed
2023-11-28 09:22:36 +00:00
Igor Chevdar b264cf2119 [K/N] Reformat 2023-11-28 09:22:36 +00:00
Anastasia.Nekrasova 00119c6a97 [K2] Disappeared UNSUPPORTED
Prohibit named parameters in function types in supertype position

^KT-59881
2023-11-28 07:55:15 +00:00
Roman Efremov 5147a5e805 [Test] Add test for current behavior of resolution of nested class type
...when it is actualized via typealias.

^KT-31636
2023-11-27 18:23:43 +00:00
Roman Efremov 205690b220 [IR] Fix incorrect matching of nested classes when actualized via typealias
Also, add tests for the cases when expect and actual nested classes
have no compatible matching to check new logic doesn't crash.

^KT-31636
2023-11-27 18:23:42 +00:00
Roman Efremov d343e40ac5 [FIR] Actualize expect nested classes in type arguments in expect actual
...checker.

^KT-31636
2023-11-27 18:23:42 +00:00
Roman Efremov cec644e9db [Test] Add test for expect nested classes unwrapping
...in type arguments, when they were actualized via
typealias.

^KT-31636
2023-11-27 18:23:42 +00:00
Roman Efremov 4aaf290c99 [FIR] Fix incorrect matching of nested classes when actualized via typealias
There are still some places in `.fir.kt` where false-positive reports
remained. This is because of IR checker, which will be fixed in next
commit.

^KT-31636
2023-11-27 18:23:42 +00:00
Roman Efremov a768ece70d [Tests] Add tests for other checkers having same problem with
...nested classes marching.

^KT-31636
2023-11-27 18:23:42 +00:00
Roman Efremov bfc775faf5 [Tests] Create test for nested classes matching when actualized via typealias
^KT-31636
2023-11-27 18:23:42 +00:00
Svyatoslav Kuzmich 6b6353f3b9 [Wasm] Add external file checker to K2
#KT-56849
2023-11-27 16:55:04 +00:00
Svyatoslav Kuzmich 7687b86654 [Wasm] Add JsModule checker to K2
#KT-56849
2023-11-27 16:55:04 +00:00
Sebastian Sellmair 977d1c0e41 [K/N] Implement objc export header test: functionWithErrorType 2023-11-27 16:39:15 +00:00
Sebastian Sellmair 04df33eec1 [K/N] Implement ObjCExportNamerTest and ObjCExportMapperTest
... to provide simple and quick validation
for their corresponding entities.

Those tests can also act as convenient entry points
for debugging.
2023-11-27 16:39:15 +00:00
Stanislav Ruban 269b60b420 [tests] Add a test case for KT-61978
^KT-61978 Obsolete
2023-11-27 15:50:46 +00:00
Ilya Gorbunov 28c1049518 [stdlib] KT-55619 provide samples and extend documentation for String.format 2023-11-27 15:04:51 +00:00
Alexander Korepanov b1465fbfb8 [JS FIR] Enable warnings and infos for JS FIR tests 2023-11-27 14:31:31 +00:00
Alexander Korepanov 862be5a787 [JS FIR] Fix FIR NON_EXPORTABLE_TYPE diagnostic bugs
- use a declaration source if a parameter source is null;
 - ignore constructor return type to avoid
   double-checking of the class itself;
 - ignore constructor type parameters
   obtained from the class declaration;
 - ignore enum entries property (it is not checked in K1 at all);
 - fix exportability check for function types;

 ^KT-63089 Fixed
2023-11-27 14:31:30 +00:00
Artem Kobzar 6615b77213 [K/JS] Rework symbol hash calculation to make IC works with @JsExport and @JsName changes 2023-11-27 13:49:56 +00:00
Leonid Startsev f7d87f6d70 Use type parameters' source information for kotlinx.serialization diagnostics
To be more consistent with K1, certain diagnostics should be reported
not on the whole properties' types, but on type arguments inside them.

Note that there is still a difference with K2 because K2 reports on a type argument
including its annotations, while K1 used KtTypeReference.typeElement.

IMO, K2 conveys the same or better meaning here, so I am willing to leave this
difference instead of providing PositioningStrategy.

#KT-53861 Fixed
2023-11-27 13:32:44 +00:00
Dmitriy Novozhilov a22a254c1e [Test] Fix passing useIrFakeOverrideBuilder flag in tests 2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 039baf95fc [Test] Add empty platform module for MPP diagnostic test with only one module
After previous commits IrActualizer runs only there are at least two modules
  in backend input. So to check diagnostics from Actualizer all tests
  should contain at least two modules

Diagnostics in test `extendExpectedClassWithAbstractMember.kt` were
  changed because there is an exception from IrActualizer caused by
  errors from frontend (`ABSTRACT_METHOD_NOT_IMPLEMENTED`), which is
  swallowed by this kind of tests
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 62d269b3b9 [AA] Use convertToIrAndActualize in KtFirCompilerFacility
It was the last place that manually called parts of fir2ir
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov ffe5b4c40d [Test] Update some IR dumps after previous changes
Now IR dump handlers receiver actualized IR with removed expected
  declarations, so corresponding tests should be updated accordingly
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 48c3313e67 [Test] Inline processAllIrModuleFragments utility
After previous changes IR output artifact contains only one IrModuleFragment
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 06af6adf4f [Test] Unify all fir2ir facades for non-jvm platforms
Setup of fir2ir for JS, Native and Wasm is very similar, so it makes
  sense to extract all common parts of it into common base facade
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov e38b25c278 [FIR2IR] Make convertAndActualize method the only entrypoint to fir2ir
Fir2Ir conversion consists of multiple steps with complex logic (like
  conversion of each module, actualization, plugins application, constant
  evaluation), and to ensure that they all are executed correctly it's
  convenient to have the single entry point for all this machinery
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 075010b14e [Test] Get rid of some properties in IrBackendInput
`fir2IrComponents`, `irActualizerResult` and `dependentIrModuleFragments`
  were used in `IrActualizerAndPluginsFacade`, which was removed in the
  previous commit
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 1303a33bea [Test] Get rid of IrActualizerAndPluginsFacade
IR actualization and IR plugins will be moved into base Fir2Ir facades
  in the following commits, so this facade is not needed anymore

It was easier and cleanlier to remove this facade first and only after
  that modify base facades
2023-11-27 10:17:54 +00:00
Sebastian Sellmair ddd97e84b9 [K/N] Implement lightweight tests for ObjC header generation 2023-11-27 09:08:54 +00:00