Commit Graph

108781 Commits

Author SHA1 Message Date
Dmitrii Gridin f972c8d239 [LL FIR] add more tests for script initializer
^KT-65344
2024-02-13 14:58:31 +00:00
Marco Pennekamp 08332fdc6e Explain issues with local.properties in verification metadata update 2024-02-13 12:54:34 +00:00
Alexander Korepanov 9ff6dcbe0a [JS FIR] Add a test for generic interface inheritance
^KT-65216
2024-02-13 12:19:29 +00:00
Alexander Korepanov c828b924b2 [JS FIR] Fix JS_NAME_CLASH false positive report
Intersections for interfaces and generic interfaces work differently.
`FirIntersectionCallableSymbol.getNonSubsumedOverriddenSymbols()`
does not retrieve the original symbol for a symbol inherited from
generic interfaces.
The patch explicitly obtains original symbols if they exist.

^KT-65216 Fixed
2024-02-13 12:19:29 +00:00
Dmitriy Novozhilov 73b608608a [FIR] Optimize PendingDiagnosticsCollectorWithSuppress
PendingDiagnosticsCollectorWithSuppress is a special diagnostic collector,
  which aggregates diagnostics reported during checking of some specific
  element before actually reporting them, so its workflow looks like this:

- start checking some element;
- all reported diagnostics go to `pendingDiagnosticsByFilePath` map;
- all checkers done their jobs;
- diagnostics from `pendingDiagnosticsByFilePath` go to the resulting map
  of all diagnostics (not all, only ones which lay inside the checked
  according to PSI);
- processed diagnostics removed from `pendingDiagnosticsByFilePath`

This approach works fine, but there was one problem with it:
  `pendingDiagnosticsByFilePath` is not just a list of diagnostic, but
  map of lists, grouped by the containing file. And only those lists
  actually get cleared. But if some list was completely emptied, it still
  remained in the original `pendingDiagnosticsByFilePath` map
This led to the performance problem in case, where there are no actual
  diagnostics in the `pendingDiagnosticsByFilePath`, but the map itself
  is not empty but full of empty lists. So collector iterated over this
  map on each visiting of each element
And after KT-58881 this problem was uncovered, as number of visits of
  elements was twiced (because now we iterate over the whole tree twice,
  with Common and Platform checkers)

The fix is quite trivial -- if some list in `pendingDiagnosticsByFilePath`
  becomes empty, remove it from the map

^KT-65579 Fixed
2024-02-13 12:07:41 +00:00
Dmitrii Gridin 0e16788b0a [FIR] value parameters from data class copy should be marked as resolved
^KT-65763 Fixed
2024-02-13 11:54:04 +00:00
Dmitrii Gridin ab7ae180f9 [LL FIR] add test data for data class from library
^KT-65763
2024-02-13 11:54:04 +00:00
cristiangarcia 15227d655f Builtins serializer logger is not required anymore
...and modifying jvmArguments in doFirst breaks ConfigurationCache
Required for KTI-1553
2024-02-13 11:22:25 +00:00
Pavel Punegov 6b9844705e [K/N] Make InfoPlistBuilder add DT* properties
The Firebase TestLab requires those properties to be present,
otherwise fails with verification errors.

These properties are specific to the Xcode installation or
toolchain used, and should be retrieved from it, not hardcoded.
See also KT-65601.

Part of the ^KT-58928


Merge-request: KT-MR-13964
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2024-02-13 11:14:24 +00:00
Sergey Bogolepov 3d0c9f9edd [Swift export][Tests] Enable K1 version of tests
rrn prefix mostly uses K1, so we need to do so
2024-02-13 10:48:05 +00:00
Sebastian Sellmair ef232ebec7 [ObjCExport] ObjCDependenciesTypesTest.test - arrayList: Remove TodoAnalysisApi
This test is now expected to pass successfully and was
introduced in one MR (muted), but fixed at the same time
in another MR
2024-02-13 10:12:18 +00:00
Alexander Korepanov 4e62400f6f Revert "[FIR2IR] Set proper offsets for generated data class members"
This reverts commit b33798d65a.

Reverted because of KT-58215


Co-authored-by: Aleksandr Korepanov <Alexander.Korepanov@jetbrains.com>


Merge-request: KT-MR-14328
Merged-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>
2024-02-13 09:52:09 +00:00
Stanislav Ruban 64083d6d5c [FIR][checkers][minor] Move FirNativeForwardDeclarationGetClassCallChecker to an appropriate package 2024-02-13 09:47:16 +00:00
Stanislav Ruban bc0633188c [FIR][checkers][minor] Move several checkers to more appropriate directories
Some FIR checkers were placed into the wrong directories either
by accident or minor oversight. This commit contains fixes
for such cases that were made during work on an internal KCCQA utility
to simplify its workings.

This commit is expected not to affect much (if anything).
2024-02-13 09:47:16 +00:00
Yahor Berdnikau 53d42df76b [Gradle] Migrate MppCInteropDependencyTransformationIT to new test DSL
^KT-65528 In Progress
2024-02-13 09:16:19 +00:00
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