Commit Graph

109329 Commits

Author SHA1 Message Date
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
Ivan Kylchik a56bebe44e [FIR2IR] Set correct endOffset for the IrBranch
We want to use end offset of branch's result as the end for the whole
branch, not just the end of its condition.

#KT-63779 Fixed
2024-01-18 10:59:01 +00:00
Kirill Rakhman 582dd1d3c0 [FIR] Only don't approximate nested captured arguments if they have recursive supertypes
This fixes a compiler crash
IllegalStateException: Captured type for incorporation shouldn't escape
from incorporation

The crash occurs when a captured type with status FOR_INCORPORATION
is two layers deep inside a captured type with status FROM_EXPRESSION.
We first check if approximation is required for the most outer captured
type in AbstractTypeApproximator.approximateCapturedType.
Then we encounter the second captured type with status FROM_EXPRESSION
in AbstractTypeApproximator.approximateParametrizedType.
At this point, we stop checking and miss the third captured type with
status FOR_INCORPORATION.

Unfortunately, we can't check recursively if nested captured types
need to be approximated because of types with recursive super types
(the original reason why the extra check was introduced).
That's why we restrict the second check to types with recursive
super types, effectively restoring the previous behavior for all other
types.

#KT-65050 Fixed
2024-01-18 09:22:15 +00:00
anzhela.sukhanova 7587f73846 [Test] KT-61937: add tests with context functions and naming clash
Update tests for ^KT-61937


Merge-request: KT-MR-13678
Merged-by: Anzhela Sukhanova <anzhela.sukhanova@jetbrains.com>
2024-01-18 08:27:31 +00:00
Kirill Rakhman cf494ada0b [FIR] Flatten ConeAttributeWithConeType when transforming
This is necessary to prevent exponential growth of the attribute
structure.
Since we usually care for the most inner value of a
ConeAttributeWithConeType like EnhancedTypeForWarningAttribute, this
shouldn't alter any behavior.
2024-01-18 08:27:10 +00:00
Kirill Rakhman b8ff04004a [FIR] Make EnhancedTypeForWarningAttribute a data class
(cherry picked from commit 76898ddb0f)
2024-01-18 08:27:10 +00:00
Kirill Rakhman d74b5c59fb [kapt] Fix new compilation warnings after #KT-63208
(cherry picked from commit 9b4ebc31c1)
2024-01-18 08:27:10 +00:00
Kirill Rakhman 228ab60476 [FE 1.0] Fix new compilation warnings after #KT-63208
(cherry picked from commit dc0f4e6995)
2024-01-18 08:27:10 +00:00
Kirill Rakhman b7b1bd0a2c [FIR] Fix parameter order of NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
(cherry picked from commit 8bfc4675c4)
2024-01-18 08:27:10 +00:00
Kirill Rakhman e91e9d8ca8 [FIR] Don't lose error level enhancements in warning-level-enhanced arguments
The error-level enhancement is kept as warning-level and a new
LanguageFeature is introduced to turn the warning into an error.

#KT-63208 Fixed
#KT-63209

(cherry picked from commit 371b1eb3d5)
2024-01-18 08:27:10 +00:00
Kirill Rakhman c39262195d [FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality
This is required for EnhancedTypeForWarningAttribute because scopes
should not be reused between cone types with different values of
this attribute.

#KT-63208

(cherry picked from commit 9189154cae)
2024-01-18 08:27:10 +00:00
Alexander Shabalin ccba52aae4 [K/N][test] Mitigate a race in WorkerTest.executeAfterOrdering
Mostly affects linux aarch64 because we run it under qemu.
2024-01-18 08:12:22 +00:00
Artem Olkov 37a8723a79 KT-64931: add convertion of kotlin top-lvl functions into swift static functions
Merge-request: KT-MR-13878
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-17 20:30:04 +00:00
Yahor Berdnikau 01824a336c [Gradle] Fix warnings in MultiplatformLayoutV2KotlinAndroidSourceSetNaming
^KT-56904 In Progress
2024-01-17 19:32:04 +00:00
Yahor Berdnikau 5ed28a6a79 [Gradle] Fix warnings in KotlinAndroidSourceSetNaming
^KT-56904 In Progress
2024-01-17 19:32:04 +00:00
Yahor Berdnikau ca996d0833 [Gradle] Fix warnings in KotlinAndroidSourceSetInfo
^KT-56904 In Progress
2024-01-17 19:32:04 +00:00
Yahor Berdnikau db62637318 [Gradle] Fix warnings in KotlinAndroidSourceSetFactory
^KT-56904 In Progress
2024-01-17 19:32:04 +00:00
Alexander Shabalin 30d6fa730e [K/N] Add separate FinalizerProcessor for main thread ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin 8a86fec38f [K/N] Add RunLoopFinalizerProcessor ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin d8fdc4d31a [K/N] Add RunLoopTimer ^KT-63423 2024-01-17 18:26:00 +00:00