Commit Graph

107808 Commits

Author SHA1 Message Date
Vladimir Sukharev fee2a20a55 [K/N][Tests] Support test directive ASSERTIONS_MODE
^KT-64844 Fixed
2024-01-10 23:31:00 +00:00
Vladimir Sukharev 809d652bdf [K/N][Tests] Change assertions and runtime assertions modes to default, when optimizationMode=OPT
^KT-64844 Fixed
2024-01-10 23:31:00 +00:00
Yahor Berdnikau 2a55aa782d Revert "[Gradle] Add dsl marker to KotlinSourceSet"
This reverts commit eb663117c7.
2024-01-10 22:10:59 +00:00
Yahor Berdnikau e8704cc556 Revert "[Gradle] Add deprecated accessor to sourceSets inside KotlinSourceSet"
This reverts commit 5fba2962b9.
2024-01-10 22:10:59 +00:00
Dmitrii Gridin cf290a73fc [Analysis API] migrate AbstractSymbolLightClassesTestBase to doTestByMainModuleAndOptionalMainFile
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 1aa2377c60 [Analysis API test] rename AbstractLowLevelApiModifiablePsiSingleFileTest to AbstractLowLevelApiModifiablePsiTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 6145255e2c [Analysis API test] extract AbstractPsiDeclarationProviderTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 0f3f0ff080 [Analysis API test] rename AbstractPsiDeclarationProviderMultiModuleBinaryTest to AbstractPsiDeclarationProviderBinaryTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 79a8b6de1f [Analysis API test] rename AbstractPsiDeclarationProviderSingleModuleTest to AbstractPsiDeclarationProviderSourceTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 052622b862 [Analysis API test] migrate more tests from doTestByModuleStructure to doTestByMainFile
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin cbae92f5c6 [Analysis API test] get rid of AbstractAnalysisApiSingleFileTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 476940c06b [Analysis API test] get rid of AbstractAnalysisApiBasedSingleModuleTest
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 095989b6fc [LL FIR] ger rid of AbstractLowLevelApiLastModuleFirstFileTest
Now this class is redundant and all tests migrated to the base class

^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 84d07ef492 [LL FIR] ger rid of AbstractLowLevelApiSingleFileTest
Now this class is redundant and all tests migrated to the base class

^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin f8d95eceb7 [Analysis API] AbstractAnalysisApiBasedTest: implement test entry points to avoid boilerplate on implementation side
There are three test entry points:
* [doTestByMainFile] – test cases with dedicated main file.
Supports everything from single-file cases to multi-platform multi-module
multi-file cases
* [doTestByMainModuleAndOptionalMainFile] – test cases rather around
modules than files
* [doTestByModuleStructure] – all other cases with fully custom logic

Look at the KDoc of the corresponding method for more details.

^KT-64805 Fixed
2024-01-10 22:07:03 +00:00
Dmitrii Gridin b67deea21f [Analysis API] introduce getKtFiles util
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin d828a646cf [Analysis API] move allKtFiles util from LL FIR module
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 1c2fac41c2 [Analysis API] ExpressionMarkerProvider: fix path for selected expressions
We are storing them by file path, but accessing them by
file name, which is inconsistent

^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin a7984c6794 [Analysis API] ExpressionMarkerProvider: do not expose implementation details
And add API for selected expressions

^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin 663b7fb76f [Analysis API] AbstractAnalysisApiBasedTest: introduce entry point for tests with main file
Pulled up the implementation from AbstractCompilerFacilityTest

^KT-64805
2024-01-10 22:07:03 +00:00
Alexander Korepanov 6df0e0c847 [JS FIR] Enable FirJsLineNumberTests for FIR
^KT-64426 Fixed
2024-01-10 19:02:15 +00:00
Alexander Korepanov ac30911497 [JS tests] Split FIR and IR output test dirs 2024-01-10 19:02:15 +00:00
Artem Kobzar 48f8f8af5f [K/JS] Fix useEsModules and useCommonJs DSL-functions ^KT-64561 Fixed 2024-01-10 18:22:08 +00:00
Artem Kobzar 300702a7e7 [K/JS] Create JavaScript Simple Object plugin that helps create typed JS objects 2024-01-10 16:30:02 +00:00
Jinseong Jeon 45b8f99107 SLC: distinguish last v.s. non-last vararg during binary resolution
^KT-64795 fixed
2024-01-10 15:36:40 +00:00
Denis.Zharkov 2bdadeb0c8 Fix instability of declaration order of KotlinStaticDeclarationProvider
It affects how some rendering-related tests behave

^KT-64771 Fixed
2024-01-10 14:56:31 +00:00
Denis.Zharkov 7e4d9d9f64 K2: Add new tests for PCLA implementation
Many of them have been found & minimized at FP tests/user projects

^KT-59791 Fixed
2024-01-10 14:56:31 +00:00
Denis.Zharkov 90feeab076 K2: Temporary mute controversial K2 IDE test after PCLA implementation
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 8365eb54dd K2: Adjust test data after PCLA implementation [multiLambdaRestriction]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov b9019d3de1 K2: Adjust test data after PCLA implementation [red-to-green]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 8459465177 K2: Adjust test data after PCLA implementation [green-to-red, controversial]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov f945dce4c8 K2: Adjust test data after PCLA implementation [green-to-red]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 6052e24626 K2: Adjust test data after PCLA implementation [red-to-red]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 276f5b26d8 K2: Implement partially constrained lambda analysis (PCLA)
It's expected to partially mimic the behavior of what
previously was called builder inference, but with more clear contracts
(documentation is in progress, though)

See a lot of fixed issues in the later commits with test data,
especially [red-to-green]

^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 9ae5287df8 K2: Pass resolution mode to CallInfo
It's going to be used for PCLA implementation in later commits

^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 3b2bc49c4d K2. Drop PostponedVariablesInitializerResolutionStage
It would be unnecessary after PCLA approach would be implemented

^KT-59791 In progress
2024-01-10 14:56:30 +00:00
strangepleasures bb8ff9e299 KT-62584 Fix generation of type arguments for local classes
Merge-request: KT-MR-13684
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-01-10 14:20:09 +00:00
Ilya Goncharov b645997dc4 [Gradle, JS] Use dev server not as property in KotlinWebpackConfig 2024-01-10 12:41:53 +00:00
Leonid Startsev fba2f5ea4e Expand most kotlinx.serialization tests on JS backend
to enhance and increase test coverage of the plugin.
2024-01-10 12:17:34 +00:00
Alexander.Likhachev 60080e8bb8 [Build] Remove redundant trove4j compileOnly dependencies
^KTI-1135 In Progress
2024-01-10 11:29:25 +00:00
Alexander.Likhachev 21b438f55d Replace the trove4j collections usages with the fastutil ones
The trove4j library is licensed under LGPL, and that causes some troubles while working with it. The fastutil library provides the same functionality in the context of our needs, and is licensed under the Apache license.
^KTI-1135 In Progress
2024-01-10 11:29:25 +00:00
Alexander Udalov dd5fffebf2 JVM: do not generate assertion message for captured fields
#KT-64615 Fixed
2024-01-10 11:10:08 +00:00
Alexander Udalov f01e633f8b JVM: do not put public field access into a single expression block
It affects the `is IrGetField` check in
TypeOperatorLowering.computeNotNullAssertionText, which leads to missing
NPE messages when accessing backing fields of public properties.

 #KT-64615
2024-01-10 11:10:08 +00:00
Nikita Bobko 96b2f13397 Make it possible to enable "non-local break and continue" with -language-version flag
We initially wanted to release the feature in 1.9.0, but found a bug in
K1 KT-54906. It was decided to postpone the feature release to 2.1, but
at this time KOTLIN_2_1 didn't exist

In this commit I make it possible to enable the feature with
-language-version 2.1 flag, so users can "preview" this feature in 2.0

KT-1436
2024-01-10 10:19:15 +00:00
Marco Pennekamp eabbe21b66 [AA] Add diagnostics tests for sealed classes/interfaces
- KT-62895 cannot be reproduced on the Analysis API side. Still, it is
  useful to add tests here for better coverage in the future.
- The reason is likely that Analysis API tests specifically use
  `SealedClassesInheritorsCaclulatorPreAnalysisHandler` to compute
  sealed class inheritors (which are usually the breaking point for
  problems in `when` exhaustiveness checking), so the tests do not use
  the production implementation. See KT-64505 for future work on this
  problem.

^KT-62895
2024-01-10 10:13:23 +00:00
Marco Pennekamp 51f1e31cce [AA] Support sealed class inheritors in dangling file tests
- In dangling file tests, the project structure's main module is a
  non-dangling file module. Sealed class inheritors are registered for
  that module. However, later when sealed class inheritors are
  requested, the FIR class has a dangling file module as its `KtModule`,
  which isn't known by the inheritors provider. We need to take the
  sealed inheritors of the context module instead.
2024-01-10 10:13:23 +00:00
Marco Pennekamp ff0224d28d [AA] Test project structure: Fix duplicate binary library modules in main module dependencies
- `TestModuleStructureFactory.createProjectStructureByTestStructure`
  created `KtModule`s for each test module and then also created new
  `KtModule`s for binary dependencies. This split worked as long as no
  binary dependency was also a test module and thus part of the main
  modules. But if not, `addLibraryDependencies` created a duplicate
  `KtModule`, instead of referring to the existing binary module.
- The fix registers a main binary library module in the library cache
  before it can become the dependency of another main module. Because
  main modules can only depend on main modules preceding them in the
  list, a separate pass over all main modules is not needed.

^KT-64647 fixed
2024-01-10 10:13:23 +00:00
Alexander Zakharenko 62facee96c [K/N] Debug output for flaky testReleaseCompilerAgainstPreReleaseLibrary
^KT-64822
2024-01-10 09:49:41 +00:00
eugene.levenetc 92affa1b24 [ObjCExport] Add initial objective-c function translation
KT-64226
2024-01-10 09:17:00 +00:00
Dmitrii Krasnov 7e61f9cb42 [Gradle] Validation for definitionFile and packageName in cinterop
^KT-62800 Fixed
2024-01-10 08:50:24 +00:00