Commit Graph

108098 Commits

Author SHA1 Message Date
Ivan Kylchik 10c687fa32 [FIR] Move most of the expression's checks into FirConstCheckVisitor
The only ones left are checking expression's symbol instead
of the expression itself.
2024-01-19 11:40:39 +00:00
Ivan Kylchik 2657cafa7b [FIR] Add session property to the FirConstCheckVisitor 2024-01-19 11:40:39 +00:00
Ivan Kylchik 7c9e5a1a4b [FIR] Move const check utils functions into FirConstCheckVisitor
This is the first step of moving all const check code into
a visitor class.
2024-01-19 11:40:39 +00:00
Ivan Kylchik 4e8adc6693 [FIR] Add new VALID_CONST entry to the ConstantArgumentKind 2024-01-19 11:40:38 +00:00
Ivan Kylchik c661f654ee [FIR] Drop useless check cast to FirCall in FirConstChecks 2024-01-19 11:40:38 +00:00
Adam Semenenko a6524be97a !fixup [Gradle] refactor Gradle task assertion utils for clarity
- Rename/update to differentiate between 'executed' tasks vs tasks
  that are not in the task graph
- de-duplicate assertTasksNotExecuted() / assertTasksAreNotInTaskGraph()
  they both did the same thing
- re-use code for verifying all tasks have a specific outcome
- add a more helpful failed assertion message if the task isn't found
- rename 'tasks' to 'taskPaths' for clarity
2024-01-19 11:21:27 +00:00
Adam Semenenko 1661957166 !fixup [Gradle] refactor Gradle task assertion utils for clarity
- Rename/update to differentiate between 'executed' tasks vs tasks
  that are not in the task graph
- de-duplicate assertTasksNotExecuted() / assertTasksAreNotInTaskGraph()
  they both did the same thing
- re-use code for verifying all tasks have a specific outcome
- add a more helpful failed assertion message if the task isn't found
- rename 'tasks' to 'taskPaths' for clarity
2024-01-19 11:21:27 +00:00
Adam Semenenko ad8341df9b [Gradle] refactor Gradle task assertion utils for clarity
- Rename/update to differentiate between 'executed' tasks vs tasks
  that are not in the task graph
- de-duplicate assertTasksNotExecuted() / assertTasksAreNotInTaskGraph()
  they both did the same thing
- re-use code for verifying all tasks have a specific outcome
- add a more helpful failed assertion message if the task isn't found
- rename 'tasks' to 'taskPaths' for clarity
2024-01-19 11:21:26 +00:00
Adam Semenenko 4b48f15d0f [Gradle] skip CheckKotlinGradlePluginConfigurationErrors if no errors
- Add an `onlyIf {}` check so CheckKotlinGradlePluginConfigurationErrors
  won't run unless there are errors,
which helps writing integration tests and preventing IJ warnings.
- remove unnecessary sequence when fetching DiagnosticsForProject
- update test assertions relating to
  CheckKotlinGradlePluginConfigurationErrors

^KT-61943 Fixed
2024-01-19 11:21:26 +00:00
Ilmir Usmanov 19283048a8 Replace bytecode text test with a stepping test
#KT-62965
2024-01-19 10:52:39 +00:00
Xin Wang 2e32e13466 JVM Codegen: Mark line number before calling of indy in SAM Conversion
Fixes: KT-62965
2024-01-19 10:52:39 +00:00
Pavel Kirpichenkov 6deb679e5c [LL] Fix incorrect KMP groups in case of reordered dependencies
KTIJ-27569
2024-01-19 10:20:52 +00:00
Pavel Kirpichenkov 98e3813af9 [LL] Add error recovery to KmpModuleSorter
KTIJ-27569
2024-01-19 10:20:52 +00:00
Pavel Kirpichenkov 24b19e3c32 [LL] Add test for KmpModuleSorter
KTIJ-27569
2024-01-19 10:20:52 +00:00
Pavel Kirpichenkov ce3c05500e [LL] Sort modules from the same KMP project in symbol providers
Sort dependency modules topologically if they belong to the same KMP
project, preserving their relative positions. Sorting all modules and
changing positions of unrelated modules can be harmful: in the case of
a classpath hell, IDE results can become different from runtime
behavior. Sorting in place can help to avoid this problem, because
conflicting declarations shouldn't be allowed in different source sets
of the same multiplatform project.

KTIJ-27569
2024-01-19 10:20:52 +00:00
Dmitriy Novozhilov 16b1caff7e [Doc] Update part of _Code authoring guideline_ about TODO processing 2024-01-19 09:59:14 +00:00
Yahor Berdnikau 6234b9960c [Gradle] Fix warnings in ExternalKotlinCompilationDescriptor
^KT-56904 In Progress
2024-01-18 22:45:58 +01:00
Yahor Berdnikau 3b837734d1 [Gradle] Fix warnings in MultiplatformLayoutV2MultiplatformLayoutV1StyleSourceDirUsageChecker
^KT-56904 In Progress
2024-01-18 21:12:28 +00:00
Yahor Berdnikau bc7c342003 [Gradle] Fix warnings in MultiplatformLayoutV2AndroidStyleSourceDirUsageChecker
^KT-56904 In Progress
2024-01-18 21:12:28 +00:00
Yahor Berdnikau 7de6fda9f2 [Gradle] Fix warnings in KotlinAndroidSourceSetLayoutChecker
^KT-56904 In Progress
2024-01-18 21:12:28 +00:00
Vladimir Sukharev 117ce133bf [K/N] Remove platform-dependent overridability check for properties
^KT-57640 Fixed
2024-01-18 18:43:08 +00:00
Alexander Shabalin 9613d0e8dc [K/N] Disable stress test with aggressive GC ^KT-63423 2024-01-18 17:53:04 +00:00
Alexander Shabalin 266208c500 [K/N] Fix finalizer handling with mimalloc ^KT-63423 2024-01-18 17:53:04 +00:00
Yan Zhulanow 50203adb72 [Analysis API] Minor, add KDoc for 'ContextCollector.Context' 2024-01-18 17:12:28 +00:00
Yan Zhulanow e393282c67 [Analysis API] Remove test infrastructure for obsolete on-air analysis 2024-01-18 17:12:28 +00:00
Yan Zhulanow 8c5c40760b [Analysis API] Minor, remove mentions of on-air analysis in KDoc 2024-01-18 17:12:28 +00:00
Yan Zhulanow 2c4fbb1eb1 [Analysis API] Minor, move out fallback computation for designation path 2024-01-18 17:12:28 +00:00
Yan Zhulanow 5d7f54500f [Analysis API] Remove 'FirTowerContextProvider'
The only implementation of 'FirTowerContextProvider' that is not
obsolete is inside the reference shortener.
2024-01-18 17:12:28 +00:00
Yan Zhulanow 9227359256 [Analysis API] Remove components of obsolete on-air analysis
On-air analysis only worked correctly inside declaration bodies, and
required special handling ('analyzeInDependedAnalysisSession()').
Dangling files, the on-air replacement, works seamlessly, and it is
available in all contexts.
2024-01-18 17:12:28 +00:00
Yan Zhulanow 9021fdaf83 [Analysis API] Remove obsolete dependentCopy tests 2024-01-18 17:12:28 +00:00
Yan Zhulanow 08727bf0be [Analysis API] Add more ContextCollector tests inspired by dependentCopy
As the on-air analysis is obsolete, related tests are going to be
deleted. Here we add cases not yet covered by 'ContextCollector' tests.
2024-01-18 17:12:28 +00:00
Yan Zhulanow 0502da474b [Analysis API] Load scripting extensions for script dangling files
The commit fixes failing 'ContextCollectorScriptTestGenerated'
for dangling file copies.
2024-01-18 17:12:28 +00:00
Yan Zhulanow e47f505eb9 [Analysis API] Use 'ContextCollector' in implicit receiver type provider
'getTowerContextProvider()', which operates on top of obsolete on-air
analysis can be replaced with more robust 'ContextCollector'.
2024-01-18 17:12:28 +00:00
Yan Zhulanow 74db837b7d [Analysis API] Remove obsolete on-air resolution tests 2024-01-18 17:12:28 +00:00
Yan Zhulanow a848a0233d [Analysis API] Add more ContextCollector tests inspired by on-air tests
As the on-air analysis is obsolete, related tests are going to be
deleted. Here we add cases not yet covered by 'ContextCollector' tests.
2024-01-18 17:12:28 +00:00
Yan Zhulanow f9c7ca3bdc [Analysis API] Test 'IGNORE_SELF' mode in context collector tests
Parent declarations of the file copy are typically unresolved in the
'IGNORE_SELF' mode, as the declaration designation contains declarations
from the original file.
2024-01-18 17:12:28 +00:00
Yan Zhulanow adb8b7b252 [Analysis API] Minor, improve naming for 'computeTestDataPath()' 2024-01-18 17:12:28 +00:00
cristiangarcia d2cfd247a5 Fix npm publishing
We are using version catalog now from this project, and we run it with -p
2024-01-18 16:53:31 +00:00
Alexander Korepanov f5d0c22736 [K2 JS] Unmute and link to issue some JS K2 tests 2024-01-18 15:48:55 +00:00
Ilya Kirillov 7773fdab9a [LL FIR] refactoring, extract duplicated code from LLFirAbstractSessionFactory 2024-01-18 15:43:52 +00:00
Ilya Kirillov 46d5d512e5 [LL FIR] refactoring, remove repeated logic of registering default components in inheritors of LLFirAbstractSessionFactory 2024-01-18 15:43:52 +00:00
Ilya Kirillov 3a90cb00c7 [LL FIR] reuse the same function for registering K/N FIR session components as in the compiler
So, if a new component is registered in the compiler, it's not forgotten for the LL FIR

This registers `FirDelegatedMembersFilter` for K/N modules and fixes KT-64528

^KT-64528 fixed
2024-01-18 15:43:52 +00:00
Ilya Kirillov 9f3c093072 [FIR] extract function for K/N FIR sessions components configuration to a separate function 2024-01-18 15:43:52 +00:00
Ilya Kirillov f203d2d731 [LL FIR] refactoring, reuse the same function for registering JS FIR session components as in the compiler
So, if a new component is registered in the compiler, it's not forgotten for the LL FIR
2024-01-18 15:43:52 +00:00
Pavel Punegov 6b409d87f5 [K/N][test] Support library for running Kotlin/Native tests with XCTest
This change adds a library with cinterop that has XCTest wrapper around
Kotlin/Native tests (that are @kotlin.test.Test marked methods).
This library can be compiled with either test code using the option
`-produce test_bundle` to make a loadable test bundle or used inside
the existing ObjC/Swift tests if compiled to a framework.

The basic idea is to make XCTest be able to resolve separate test cases
and correctly show them in test reports. This was achieved by wrapping
test cases with dynamically created invocation methods. Test listeners
are integrated with XCTest Observation to make it possible to have 
the same ability to report with GTest or TeamCity logging.

Gradle build files use MPP Gradle plugin and use a bootstrap version
of K/N. Property `kotlin.native.home` was moved to the kotlin-native
subproject to not override this project's K/N distribution, that is
being used by the KGP with the same property.

This is a part of ^KT-58928


Merge-request: KT-MR-13268
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2024-01-18 15:04:37 +00:00
Ivan Kochurkin e3ddc843bc [FIR] Fix and simplify FirUnsupportedArrayLiteralChecker 2024-01-18 14:39:54 +00:00
Ivan Kochurkin 2be9a341ca [FIR] Report ARGUMENT_TYPE_MISMATCH for nested array literals
^KT-61843 Fixed
2024-01-18 14:39:54 +00:00
Ivan Kylchik aecf05c4ac [FIR] Use ConeKotlinType to represent vararg's element type
We are using `ConeKotlinType` instead of `FirTypeRef` to represent
that element type of vararg doesn't have any source. It has a type
that was inferred. If we try to specify a source, then we could
end up with the incorrect place for diagnostic.

#KT-59682 Fixed
2024-01-18 13:33:48 +00:00
Aleksei.Cherepanov a4a433fd65 Follow-up commit for 1e7e42ba with refactoring
^KT-65043 Fixed
2024-01-18 12:32:35 +00:00
Ivan Kylchik 86e6912447 [FIR2IR] Don't generate excess IR block from FirSingleExpressionBlock
This is needed to unify K1 and K2 behavior.

#KT-65064
#KT-63781 Fixed
2024-01-18 10:59:01 +00:00