Commit Graph

106151 Commits

Author SHA1 Message Date
Mikhail Glukhikh 4d49bdb8ca K2: add a black box test to confirm KT-53718 now works properly (JVM IR only)
Related to: KT-57584, KT-58110
2023-11-15 09:33:05 +00:00
Mikhail Glukhikh 4b1368409d K2: add a black box test to confirm KT-55705 now works properly 2023-11-15 09:33:05 +00:00
Mikhail Glukhikh f2ef41dbbd K2: add a black box test for KT-58874 to confirm work also in runtime 2023-11-15 09:33:03 +00:00
Kirill Rakhman ed53d45307 [FIR] Add TODO for deprecation and fix of error-level nullable arguments of warning-level annotated Java type
#KT-56989
#KT-63208
2023-11-15 08:43:55 +00:00
Kirill Rakhman 2005446296 [FIR] Preserve enhanced mutability when nullability was enhanced for warning
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman a63ec9efdc [FIR] Implement warnings for java nullability upper bound violation 2023-11-15 08:43:55 +00:00
Kirill Rakhman 2df1e9dde6 [FIR] Implement warnings for java nullability type mismatch on override
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman a6fdeeb7df [FIR] Implement warnings for java nullability type mismatch
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman 1ecbc094ec [FIR] Save warning-level enhanced types to an attribute
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman ef96912573 [FIR] Apply withNullability to attributes with cone types
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman 7910e8ad24 [FIR] Implement a special type of attribute that contains a cone type that can be transformed 2023-11-15 08:43:55 +00:00
Kirill Rakhman 8ebd2fd1b7 [FIR] Implement add in AbbreviatedTypeAttribute 2023-11-15 08:43:55 +00:00
Kirill Rakhman ad4d021cbf [FIR] Reformat AbbreviatedTypeAttribute 2023-11-15 08:43:55 +00:00
Kirill Rakhman 51a3fe367c [Tests] Fix deadlock caused by eager initialization in JspecifyMarksCleanupPreprocessor 2023-11-15 08:43:55 +00:00
Yahor Berdnikau 59f544cb7c [Gradle, Kapt] Don't immediately check if kaptClasspath dependencies are empty
Now sub-plugins are applied to compilation before users `afterEvaluate`
closure execution, which could lead to unexpected by the user state.
For example, when a user adds dependencies to 'kaptClasspath' in
'afterEvaluate'.

This fix removes check in Kapt plugin if dependencies are present on
'kaptClasspath' and moves it into KaptTask.onlyIf spec. So the task
will still have SKIPPED state if there are no AP provided.

^KT-63366 Fixed
2023-11-15 08:42:28 +00:00
Nikolay Lunyak 80cccce8d0 [FIR] Use the proper processAll* functions for CONFLICTING_OVERLOADS
The `*leaf*` functions were
introduced due to my false
assumption. The normal processing
functions only collect leafs
already. `*leaf*`s are bad, because
they don't cache anything.

The change in
AbstractFirOverrideScope reflects
KT-63290, and is needed to avoid
duplicate `CONFLICTING_OVERLOADS`
and `VIRTUAL_MEMBER_HIDDEN`.
2023-11-15 07:56:32 +00:00
Nikolay Lunyak 008703c1dc [FIR] Fix parameters constraints in FirDeclarationCollector<D>.collect 2023-11-15 07:56:32 +00:00
Nikolay Lunyak 44d6d10233 [FIR] Only check conflicting callables that may clash with declared ones
This change improves performance, as
checking callables via scopes in
`4e587157` turns out to be quite
slow, and it also prevents some redundant
diagnostics.
2023-11-15 07:56:32 +00:00
Nikolay Lunyak 9e57aba448 [FIR] Add a test for KT-26045
^KT-26045 Fixed

Merge-request: KT-MR-13023
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-11-15 07:52:11 +00:00
Anton Lakotka 951830fcef [Gradle] Use source set name for Cinterop configurations
This will ensure that source set have isolated Cinterop configurations.
With proper extendsFrom relations.
And prevent from dependencies i.e. from linuxMain to nativeMain if they
both have the same set of underlying targets.

^KT-63338 Verification Pending
2023-11-14 22:26:27 +00:00
Anton Lakotka 645d263474 [Gradle] Test that source set have own Cinterop configurations
It is necessary to prevent leaking dependencies in source set hierarchy
i.e. if linuxMain depends on some project with cinterops and
nativeMain also have the same set of underlying targets it is important
that nativeMain should not see any dependencies from linuxMain!

And vice versa, if linuxMain should see own + parents dependencies.

^KT-63338
2023-11-14 22:26:26 +00:00
Roman Golyshev d865a44c94 KT-61890 [AA] Add test for ContextCollector at loop variable position
This turns out to be important for conflict resolution in
postfix completion in K2 IDE (see `KotlinDeclarationNameValidator`)
2023-11-14 22:15:05 +00:00
Roman Golyshev 47a00bf97e KT-61890 [AA] Use ContextCollector in KtFirScopeProvider
^KT-61890 Fixed
2023-11-14 22:15:04 +00:00
Roman Golyshev 4f136cde31 KT-61890 [AA] Add testdata to ensure KDoc completion support in IDE
Completion in the IDE relies on correct scopes for KDoc positions.
So we add testData for `KtScopeProvider` and `ContextCollector`
to ensure that there are no regressions
2023-11-14 22:15:04 +00:00
Vladimir Sukharev 1b1df9f0db [K/N] Create test model for building/executing C-Interop tests
^KT-63287 Fixed
2023-11-14 19:35:52 +00:00
Svyatoslav Scherbina 8d20d5b16c Native: support objcExportReportNameCollisions=true binary option
This binary option makes the compiler emit a warning whenever it mangles
a name emitted by ObjCExport.

^KT-63153 Fixed
2023-11-14 19:24:43 +00:00
Yahor Berdnikau 656b61b945 [Gradle] Restore writing errors into <project_dir>/.gradle directory
This is required for compatibility with older IDEA releases where it
expects errors only in <project_dir>/.gradle/kotlin/errors directory.

It is possible to disable such behaviour via
"kotlin.project.persistent.dir.gradle.disableWrite" property.

^KT-58223 Fixed
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 070de9cc85 [Gradle] Split global and project persistent caches
Now for project persistent caches plugin will use '<rootDir>/.kotlin'
directory. Global persistent cache has stayed in the
'<user.home>/.kotlin' directory.

^KT-58223 Fixed
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 5413973891 [Gradle] Add integration test checking 'kotlin.user.home' is possible to change
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau e8a7c53dde [Gradle] Use for Gradle IT tests custom location for kotlin.user.home
Such way, we could easily clean all persistent storage produced by
test runs.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 3d94679db4 [Gradle] Migrate errors collector to new persistent storage
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau cf44bff164 [Gradle] Change property name to 'kotlin.user.home'
To be analogous to GRADLE_USER_HOME as they serve almost the same
purpose.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau ce695de84d [Gradle] Migrate metadata caches to new persistent location
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 0d57436bce [Gradle] Introduce persistent storage dir in 'user.home/.kotlin'
This storage directory should be used for:
- files that should live between builds
- files that should stay after calling 'clean' task
- some persistent caches that are usually better to keep around

In this commit, we are introducing the first cache type - for session
flag files. Such files should be unique per-project. To distinguish
between different projects, md5 hash of the project root dir absolute
path is used.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Anton Lakotka 73c76c5b2d [Gradle] Add KOTLIN_PERSISTENT_GRADLE_DATA_DIR with .kotlin/ as default
Don't store data in `.gradle` as it treated specially by gradle i.e.
they are exclude this dir from UP-TO-DATE checks. This can lead into
broken IDE import state which is not fixable by re-importing.

Move CInterop Commonized libraries and Metadata Transformation results
to new KOTLIN_PERSISTENT_GRADLE_DATA_DIR to avoid IDE import issues.

^KT-58223
2023-11-14 18:38:12 +00:00
Ilya Goncharov 405a502675 [Gradle, Wasm] Tests can be up-to-date, and use by default chrome headless
^KT-62633 fixed
2023-11-14 17:58:42 +00:00
Stanislav Ruban b2fb37043d [tests] Regenerate configurations for diagnostic tests 2023-11-14 17:58:21 +00:00
Stanislav Ruban c7caca8ccd [tests] Refactor code examples relevant to exploration of KT-22004 2023-11-14 17:58:20 +00:00
Stanislav Ruban d0958068c9 [tests] Add code examples from exploration of KT-22004 2023-11-14 17:58:20 +00:00
Brian Norman ed4a778aa7 [FIR2IR] Convert data class properties of type dynamic for hashCode
Properties of type dynamic within a data class cause compilation to fail
when converting FIR to IR. This is because dynamic types do not have a
proper backing class for symbol lookup. However, dynamic types can just
be considered of type Any for hashCode calculations.

^KT-63094 Fixed
2023-11-14 17:45:04 +00:00
Denis Lochmelis 4b3dfe6e6e [KT-58995] Fix UPUB bug
Add an explanation comment
2023-11-14 17:34:27 +00:00
Dmitriy Dolovov d8eee222af [KLIB] API 4 ABI: Add information about backing field annotations
^KT-62259
2023-11-14 17:20:45 +00:00
Dmitriy Dolovov 01f072bb7d [KLIB] API 4 ABI: Add tests for public members of EEC 2023-11-14 17:20:45 +00:00
Ilya Goncharov 11b7c35eab All tasks related to typescript generation made configuration avoidance compatible
^KTI-1471 fixed
2023-11-14 16:53:23 +00:00
Igor Chevdar e43b232786 [K/N] Used KlibFingerprint hash instead of slow SHA-256 2023-11-14 16:06:47 +00:00
Igor Chevdar cc69df0de6 [K/N] Optimized libraries hash computation
#KT-63081 Fixed
2023-11-14 16:06:47 +00:00
Yahor Berdnikau ea49a9a292 [Gradle] Limit max heap size for Kotlin daemon in integration tests
This change should further reduce memory pressure on running these tests
on CI agents.

Kapt4 tests require more Kotlin daemon memory than default 1g. It is
a known issue and eventually should be addressed by the compiler team.
2023-11-14 15:40:38 +00:00
Nikolay Lunyak 425d5e808b [FIR] Link some tests with issues
Just in case.

^KT-59874
2023-11-14 15:19:33 +00:00
Nikolay Lunyak 41c5934d4e [FIR] Don't forget to ignore hidden imports
^KT-59874
2023-11-14 15:19:33 +00:00
Nikolay Lunyak c656a83a02 [FIR] Don't miss non-const annotation args
This code with `b()` crashes the JVM
backend.

^KT-59822 Fixed
^KT-59874
2023-11-14 15:19:33 +00:00