Commit Graph

108766 Commits

Author SHA1 Message Date
cristiangarcia f22688c4c8 Make :plugins:parcelize:parcelize-compiler:test ConfigurationCache compatible
Required for KTI-1553
2024-02-13 08:44:18 +00:00
Artem Olkov 6cd2a5932a Fix generation of KtBridges, now it is using actual C Function Name
Merge-request: KT-MR-14337
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-13 08:03:33 +00:00
Vladimir Sukharev 6c78ec88c2 [K/N][Tests] Cleanup support code for objCFrameworks in old testinfra
^KT-61259
2024-02-13 07:43:25 +00:00
Filip Dolník a4854cf81f [Gradle] Fix that CInterop commonizer modified project description
KT-65754
2024-02-13 07:38:50 +00:00
Dmitrii Gridin addbb713a5 [LL FIR] FileStructure: collect diagnostics from bottom to top
In this way, we can be sure that all nested declarations will be fully
resolved before the outer one. As an example, we had a workaround for
file diagnostics as its `FileStructure` element resolves the file only
to `IMPORTS` phase yet.
Also, this commit probably should improve the performance of highlighting
as we will trigger the resolution from bottom to top while other
highlighting passes will iterate from top to bottom.

^KT-65562
2024-02-12 23:14:12 +00:00
Dmitrii Gridin 31852c6c05 [LL FIR] FileStructure: support dangling modifier list in non-end position
The root cause of the exception is that we missed such an element, and
it led to unresolved declaration during iteration over file declarations

^KT-65562 Fixed
2024-02-12 23:14:12 +00:00
Sergej Jaskiewicz 80240198d2 [FIR2IR] Coerce to Unit for last statement in Unit-typed IrBlocks
^KT-59781 Fixed
2024-02-12 21:16:41 +00:00
Sergej Jaskiewicz eec10f3f2c [test] Reproduce KT-59781 2024-02-12 21:16:41 +00:00
Anna Kozlova 932ad3e2c1 [AA] an expression in delegated super entry is used as expression
^KT-65665 fixed
2024-02-12 20:38:23 +00:00
Alexander Shabalin 7702374dbd [K/N][tests] In atomicfu make check task run all backends ^KT-65392
- test task will run JVM and JS backend tests; called by CI
- nativeTest will run Native backend tests; called by CI
- check will run all backends tests; called locally;
2024-02-12 17:52:38 +00:00
Alexander Shabalin d92eecb985 [K/N][tests] Add :nativeCompilerUnitTest and :nativeCompilerTest ^KT-65392
- :nativeCompilerUnitTest are unit tests on K/N compiler.
- :nativeCompilerTest are tests using K/N compiler and should be run in
  many different compilation modes that K/N supports.
2024-02-12 17:52:38 +00:00
Vladimir Dolzhenko 038fe15dd4 PsiLiteral have to provide reference(s)
#KTIJ-28769 Fixed


Merge-request: KT-MR-14314
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-02-12 17:16:32 +00:00
Yahor Berdnikau e1533579f9 [Gradle] Limit Gradle daemon memory to 1g
Limiting spawned by our Gradle integrations tests Gradle daemons maximum
heap size to 1g helps to reduce memory pressure on the system when
running these tests in parallel. Especially it is actual for our CI
agents.

^KT-65701 Fixed
2024-02-12 16:41:46 +00:00
Sebastian Sellmair 7cf6a86083 [ObjCExport] translateToObjCType: Filter konan primitives and include supertypes for mapped types
^KT-65348 Fixed
2024-02-12 16:14:38 +00:00
eugene.levenetc 7628d1a4aa [ObjCExport] Add function with Char return type test
KT-65348
2024-02-12 16:14:38 +00:00
Sebastian Sellmair fd33249c47 [ObjCExport] Add tests for Char type translation
^KT-65348 Fixed
2024-02-12 16:14:38 +00:00
Sebastian Sellmair e53e94516f [ObjCExport] AA: Enable generation of base declarations
^KT-65738 Fixed
2024-02-12 16:13:50 +00:00
Sergey.Shanshin 2ae2f09fee [FIR] Fixed phase for FirCompanionGenerationProcessor to COMPANION_GENERATION
Phase COMPILER_REQUIRED_ANNOTATIONS causes errors in the kotlinx serialization tests:

org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException: `lazyResolveToPhase(COMPILER_REQUIRED_ANNOTATIONS)` cannot be called from a transformer with a phase COMPILER_REQUIRED_ANNOTATIONS.
`lazyResolveToPhase` can be called only from a transformer with a phase which is strictly greater than a requested phase;
 i.e., `lazyResolveToPhase(A)` may be only called from a lazy transformer with a phase B, where A < B. This is a contract of lazy resolve
2024-02-12 15:54:11 +00:00
Sergey.Shanshin 7af2aebbe2 [FIR] Fixed resolving type by FirUserTypeRef if type is parametrized
If a parameterized type ref is passed during the `FirSupertypeGenerationExtension.TypeResolveService#resolveUserType` call, the `WRONG_NUMBER_OF_TYPE_ARGUMENTS` error occurs.
2024-02-12 15:54:11 +00:00
Sergey.Shanshin 84ad12be57 [KxSerialization] Added inspections on custom serializer parameters
Added inspections to check:
- custom serializer on class has as many parameters in primary constructor as the serializable class of type arguments
- all parameters in custom serializer has `KSerializer` type
- property in serializable class not parametrized by type parameter
- custom serializer on property of serializable class have no parameters in primary constructor
2024-02-12 15:54:11 +00:00
Pavel Kunyavskiy 9532172a22 [Fir2IR] Don't use FIR f/o builder when IR f/o builder is enabled
Before this commit, fir f/o builder was inconsistently
disabled in some places, while it should work only for lazy declarations

Attempt to use it for non-lazy declarations, without maintaining
invariant, that it would also be used for super classes
led to unpredictable results.

This commit introduces opt-in, and marks all related API to three types
* Propagate error to user
* Fine to use, as it's checked if ir f/o builder is enabled
* Fine to use, as it is definitely a lazy class.

Several cases of missing checks was fixed.

^KT-65707
2024-02-12 15:02:50 +00:00
cristiangarcia 74193aefb4 Kotlin maven publication tasks are not compatible with Configuration Cache
Required for KTI-1553
2024-02-12 14:45:06 +00:00
Yahor Berdnikau cf1a1693b3 [Gradle] Remove exceptions for warnings-as-errors flag enable
^KT-56904 Fixed
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 11fee106b2 [Gradle] Fix warnings in kotlin-native-build-tools
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau de40306f8e [Gradle] Fix warnings in KotlinPerformancePlugin
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 05f3019fcf [Gradle] Fix warnings in experimentalConifguration.kt
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau d2c8565d55 [Gradle] Fix warnings in SetupKotlinNativePlatformDependenciesAndStdlib
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau e10b4066d5 [Gradle] Fix warnings in KotlinNativeTargetPreset
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau afd5dbec81 [Gradle] Fix warnings in DefaultCInteropSettings
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau bbf933ce70 [Gradle] Fix warnings in YarnWorkspaces
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 40fa94b23b [Gradle] Fix warnings in Yarn
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Yahor Berdnikau 00f8c23092 [Gradle] Fix warnings in KotlinNpmInstallTask
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau aba89b6676 [Gradle] Fix warnings in CreateTargetConfigurationsSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 1ad9462c72 [Gradle] Fix warnings in CreateDefaultCompilationsSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau e72704ce86 [Gradle] Fix warnings in ConfigureBuildSideEffect
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 36233bd17d [Gradle] Fix warnings in GradleLoggerAdapter
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 3586f624a3 [Gradle] Fix warnings in kotlinTargetPresets.kt
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
Yahor Berdnikau 85f7dd1c20 [Gradle] Fix warnings in kotlinTestDependencyManagement.kt
^KT-56904 In Progress
2024-02-12 14:39:32 +00:00
eugene.levenetc 0ec9f2a8b9 [ObjCExport] Constructors fixes, cloneables handling, annotations 2024-02-12 13:30:07 +00:00
cristiangarcia 545753ff4c Dokka is not compatible with ConfigurationCache
Required for KTI-1553
2024-02-12 12:13:59 +00:00
cristiangarcia a9d0e8574e Make artifacts-tests:test ConfigurationCache compatible
Required for KTI-1553
2024-02-12 12:06:12 +00:00
Sergej Jaskiewicz 5836067082 [klib] Add error suppression to a signature clash diagnostic test
Currently, REDECLARATION is not reported if two conflicting declarations
are in different source sets (KT-59898). However, when it's fixed,
we want this test to keep testing the signature clash diagnostic,
and not fail because of unexpected REDECLARATION error.
2024-02-12 11:22:47 +00:00
Sergej Jaskiewicz f26e470e80 [klib] Don't show signature clash diagnostics for local declarations
For some reason type parameters end up in
`GlobdalDeclarationTable`, and thus we tracked them in
`IdSignatureClashDetector`, which wasn't right and confused the
diagnostic renderer that uses
`org.jetbrains.kotlin.resolve.MemberComparator` for sorting the
declarations to display in diagnostics. That comparator doesn't know
jow to work with type parameters.

Besides, type parameters, like many other types of declarations, are not
considered public wrt KLIB ABI, so there's no need to show
CONFLICTING_KLIB_SIGNATURES_ERROR for them.

^KT-65723 Fixed
2024-02-12 11:22:46 +00:00
strangepleasures e363a1228d KT-65404 KAPT should print a warning if stub generation is triggered for an interface with method bodies but without -Xjvm-default=all or -Xjvm-default=all-compatibility
Merge-request: KT-MR-14139
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:17:32 +00:00
Pavel Mikhailovskii d75463a7d5 [KAPT] KT-65399 Fix rendering of types with names starting with $.
Solves a specific issue with Kotlin serialization, and most likely,
similar issues with synthetic classes.

Types with `$` in other positions will be still rendered incorrectly
due to imprecise conversion of such types from Kotlin to Java
in the analysis API.


Merge-request: KT-MR-14235
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:15:36 +00:00
Kirill Rakhman 58264e177f [FIR] Improve UPPER_BOUND_VIOLATED message
Suggest removing explicit type arguments when the upper bound is a
captured type since the only way to satisfy the upper bounds is
by letting the type variable be inferred to its bound.

#KT-65681 Fixed
2024-02-12 10:42:51 +00:00
Kirill Rakhman 91e4837c95 [Tests] Add test for #KT-65712 2024-02-12 10:42:51 +00:00
Kirill Rakhman 9391ff8179 [FIR] Implement toString in FirTypeRefSource 2024-02-12 10:42:50 +00:00
Pavel Kirpichenkov 3dede06d51 [Tests] Add diagnostic tests for sealed class inheritors
- Fix unrelated resolution errors in an existing test
- Add separate test for sealed classes and interfaces in HMPP projects,
located in different source sets

KT-64919
2024-02-12 10:17:20 +00:00
Nikolay Lunyak 3db7df6898 [FIR] Fix FirDuplicateParameterNameInFunctionTypeChecker
It was supposed to check only function types...

Also note that it's probably impossible
to write a simpler test right now,
because we have a massive problem that
we ignore `FirTypeRef`s with `null`
sources despite having a dedicated
family of checkers for them
specifically. This will be fixed
separately as KT-65647.

^KT-65584 Fixed
^KT-65647
2024-02-12 09:00:15 +00:00