Commit Graph

99029 Commits

Author SHA1 Message Date
Denis.Zharkov bdb1e28912 K2: Minor. Simplify condition at FirDeclarationsResolveTransformer
Just to avoid double negation at !hasNonDefaultAccessors
2023-02-21 18:39:39 +00:00
Artem Kobzar 775da5d3d2 [K/JS] Fix publishing of the stdlib compiled with the legacy js compiler 2023-02-21 18:10:15 +00:00
Pavel Mikhailovskii d81170fbcc KT-56840 [SLC] Don't mark primitive-backed types with @NotNull 2023-02-21 17:29:16 +00:00
Ilya Goncharov bcb517d66b [Gradle, JS] Distinguish cache directories for js ir incremental compilation
[Gradle, JS] Make cleanOutputsAndLocalState as member method

^KT-56765 fixed
2023-02-21 16:37:37 +00:00
Pavel Mikhailovskii 81746e5aa1 KT-56508 Add a test 2023-02-21 16:22:26 +00:00
Ilmir Usmanov bfa2937fb8 FIR2IR: Do not add fake override if the member is overridden
#KT-56398 Fixed
2023-02-21 17:18:01 +01:00
Alexander Korepanov 3c9d653595 [JS IR] Ignore unbound symbols in IC infrastructure
The IR linker is responsible for detecting unbound symbols,
 if it skips them for some reason, IC infrastructure must not fail
 with unbound symbols exceptions. Anyway, the IR validator
 verifies later if there are unbound symbols in
 reachable IR and generates the corresponding error.

^KT-56602 Fixed
2023-02-21 14:46:44 +00:00
Yahor Berdnikau ff22f456a0 Fix KGP integration tests tasks run tests with other tags
Before this change specific test task (for example 'kgpJvmTests') will
run also test cases that included into test class annotated with
"JvmKGP" tag, but test case itself annotated with, for example,
"OtherKGP". Now specific test tasks should only run tests for given test
 tag.
2023-02-21 14:42:39 +00:00
Nikita Bobko 9a865e4c55 [FE 1.0] Issue a warning if expect and actual are declared in the same module
The commit is based on b09561c3c3
Co-authored-by: Dmitriy Novozhilov <dmitriy.novozhilov@jetbrains.com>

^KT-40904 Fixed
^KT-55177 Fixed
Review: https://jetbrains.team/p/kt/reviews/8731

True negative test already exist:
`compiler/testData/diagnostics/tests/multiplatform/hmpp/multiplatformCompositeAnalysis/intermediateWithActualAndExpect.kt`
2023-02-21 14:45:46 +01:00
Nikita Bobko 456605542c Make it possible to run hmpp tests with ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE
In scope of KT-40904 KT-55177
Review: https://jetbrains.team/p/kt/reviews/8731

In order to make it possible to run hmpp tests with
`ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE`, a dependency manager
must be implemented. This commit implements some basic dependency
manager. I'm not sure in its correctness because
`CommonDependenciesContainer` is an awkward API, but this dependency
manager works for my cases.

Why: I need hmpp + `ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE`
infrastructure to cover `ExpectActualInTheSameModuleChecker` (I will add
the checker in the next commit) with tests. The checker couldn't be
covered with regular hmpp tests because regular hmpp tests and
`K2MetadataCompiler` run the compiler in a different way.
Contrary, `ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE` runs the compiler in a
way `K2MetadataCompiler` does it.

I moved some tests from hmpp to `hmpp/multiplatformCompositeAnalysis`
because otherwise the tests would fail after I implement
`ExpectActualInTheSameModuleChecker` in the next commit.

Also the descriptor dumps were changed
(intermediateWithActualAndExpect.txt and
sealedInheritorsInComplexModuleStructure.txt). It happened because now
common source sets are no longer "squashed" into a single source set but
rather correct dependencies between source sets are established. And
each source set is analyzed separately (exactly like in
K2MetadataCompiler)
2023-02-21 14:45:45 +01:00
Denis.Zharkov 14ca12b50b K2: Add test for obsolete KT-56663
It was fixed via 898a9a0f2c together with
KT-53966

^KT-56663 Obsolete
2023-02-21 12:36:04 +00:00
Denis.Zharkov 0c9fad87c3 K2: Fix deserialization of upper bound of type parameter in nested class
Previously, containingDeclarationSymbol for V was set to the outer class
BaseRoot, so its upper bounds was computed to the ones from TNested
at org.jetbrains.kotlin.fir.resolve.calls.CreateFreshTypeVariableSubstitutorStageKt.getTypeParameterFromExpandedClass

^KT-56706 Fixed
2023-02-21 12:35:34 +00:00
Denis.Zharkov 9f51d3fbeb K2: Minor. Make properties private in FirTypeDeserializer 2023-02-21 12:35:34 +00:00
Svyatoslav Scherbina f206ff950c [K2/N] Ignore kt15016.kt test because it fails due to KT-56747 2023-02-21 11:52:06 +00:00
Egor Kulikov 694ef8e52d [FIR] Use stubs to get context receiver list and name of label
Thirteenth step for ^KT-52615

Merge-request: KT-MR-8911
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-02-21 10:44:02 +00:00
Anton Lakotka 1dd9751f99 [Gradle] Add mavenScope parameter to createSourcesJarAndUsageContextIfPublishable
^KT-55881 Verification Pending
2023-02-21 10:15:38 +00:00
Anton Lakotka f8e1b51f04 [Gradle] Rename publishableSources to isSourcesPublishable
^KT-55881 Verification Pending
2023-02-21 10:15:38 +00:00
Anton Lakotka 5b0a9c7a55 [Gradle] Update kotlin-gradle-plugin-api.api
^KT-55881 Verification Pending
2023-02-21 10:15:37 +00:00
Anton Lakotka e5ec028500 [Gradle] Add withSourcesJar tests
^KT-55881 Verification Pending
2023-02-21 10:15:37 +00:00
Anton Lakotka 9f32d916f9 [Gradle] Move publishableSources flag to InternalKotlinTarget
^KT-55881 Verification Pending
2023-02-21 10:15:37 +00:00
Anton Lakotka 4329b66c60 [Gradle] Don't publish sources when withSourcesJar(publish = false)
^KT-55881 In Progress
2023-02-21 10:15:36 +00:00
Anton Lakotka 1b3b83755e [Gradle] Add withSourcesJar to gradle dsl
* Each target can be configured to either publish or not its sources.
* For convenience withSourcesJar available also on kotlin multiplatform
  extension level. It then calls `withSourcesJar` for each target.

^KT-55881 In Progress
2023-02-21 10:15:36 +00:00
Ivan Kylchik 4060cc2750 Regenerate tests for FirPsiBlackBoxCodegen to include kt56215 2023-02-20 21:39:10 +01:00
Pavel Mikhailovskii 752ba433cc KT-53846 LT: Copy context receivers to secondary constructors 2023-02-20 18:13:54 +00:00
Svyatoslav Scherbina 873d9b565a Bump Kotlin/Native version to 1.9.0-dev-2063 2023-02-20 16:49:00 +00:00
Sebastian Sellmair 0929e8e30b [Gradle] Resolve cinterops only from a single source set of a given dependency
^KT-56729 Verification Pending
2023-02-20 16:30:11 +00:00
Sebastian Sellmair c5d219f154 [Gradle] KT-56729: Assert no 'duplicated libraries' warning
^KT-56729 Verification Pending
2023-02-20 16:30:10 +00:00
Sebastian Sellmair d103f60af8 [Commonizer] Demote duplicate dependency libraries to 'warning'
^KT-56729 Verification Pending
2023-02-20 16:30:10 +00:00
Sebastian Sellmair 7026ca9952 [Gradle] KT-56729: Implement 'commonize-kt-56729-consume-library-with-two-roots' test
... to cover KT-56729
2023-02-20 16:30:10 +00:00
Ivan Kylchik 477d092bb8 Avoid object's interpretation with nullable type
#KT-56215 Fixed
2023-02-20 15:52:52 +00:00
Denis.Zharkov 99448b77f3 FIR2IR: Imitate K1 behavior when SAM type has a bit different shape
See the relevant test at t/
estData/codegen/box/sam/contravariantIntersectionType.kt

After the previous commit, when generating a call for `doOnSuccess {}`,
we have a SAM type with removed projection Consumer<Any?>, while
real function type of the lambda is a bit different
(Function1<ConcreteType & ConcreteType2>).

While for me, that looks questionable, but in K1 it was effectively
resolved via the same implicit cast that on JVM is generated to an
INVOKEDYNAMIC that wraps initial function-typed value.

^KT-53552 Fixed
2023-02-20 14:54:09 +00:00
Denis.Zharkov 05ca001310 FIR2IR: Repeat the K1 behavior: SAM conversion with 'in' projection
It would be more consistently to prohibit the behavior from the unmuted
test (see KT-52428), but it was decided to postpone the breaking change.

Unfortunately, it didn't work to make a test where for computing
star projections we would need to substitute other type parameters
because effectively, it's not allowed to have SAM conversion when
star projections/wildcard is based on a type parameter which bounds
use other type parameters.

^KT-53552 In progress
2023-02-20 14:54:09 +00:00
Denis.Zharkov 45eefab811 FIR2IR: Drop the-same-value property from ConversionTypeContext 2023-02-20 14:54:09 +00:00
Alexander Korepanov e107de6f36 [JS IR] Use a guard file for preventing incremental caches corruption
If a developer interrupts (kill gradle process) a compilation process or
 an internal error interrupts the compilation process,
 the incremental cache files may be corrupted.
 The patch creates a special guard file, which allows detecting
 if the previous compilation was not successful,
 and in case of any issues drops the incremental cache files.

^KT-56581 Fixed
2023-02-20 13:14:30 +00:00
Jinseong Jeon 527fc68778 ULC: match value parameter name of enum's valueOf 2023-02-20 14:07:01 +01:00
Ilya Kirillov b05a6e6e02 [Analysis API FE1.0] support multimodule tests for FE1.0 Analysis API 2023-02-20 11:01:32 +00:00
Ilya Kirillov 803c3b88ac [Analysis API] fix exception on symbol restore when symbol cannot be seen from the use-site module
^KT-56763 fixed
2023-02-20 11:01:32 +00:00
Ilya Kirillov ee1b018c9a [Analysis API] introduce a helper test function to get carets at multimodal tests 2023-02-20 11:01:31 +00:00
Vladimir Sukharev 24696915f4 Use simplest way to split text to lines on all targets
Merge-request: KT-MR-8858
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-20 10:55:04 +00:00
Egor Kulikov 6bb71b44f6 [FIR] Use lazy constructor delegate even if there's no KtConstructor
Twelfth step for ^KT-52615

Merge-request: KT-MR-8895
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-02-20 10:50:09 +00:00
Ilya Kirillov 477072b3e7 [Analysis API FIR] remove duplicated override of Fe10SyntheticPropertyAccessorReference.resolvesByNames 2023-02-20 10:28:56 +00:00
Ilya Kirillov 78d0749235 [Analysis API FIR] implement SyntheticPropertyAccessorReference.canBeReferenceTo for fir reference
it might improve find usages performance

^KTIJ-24696
2023-02-20 10:28:55 +00:00
Dmitriy Novozhilov 8d587322e9 Regenerate tests 2023-02-20 12:06:24 +02:00
Svyatoslav Scherbina 369ca6b4eb [K/N][tests] Skip CachesAutoBuildTest when cacheMode == none
These tests rely on cacheMode != none.
2023-02-20 09:21:32 +00:00
Ilya Kirillov 6eda2742ff [LL FIR] optimize time spent in LLFirSessionsCache.getSessions
The most time were spent in `PersistentMap.get`, replacement to regular hash map should help.
This is thread-safe as we safe-publish the value via the volatile field `mappings`

^KTIJ-24697 fixed
2023-02-20 09:09:16 +00:00
Dmitriy Novozhilov e5b4cf9f04 [Test] Update serialization tests according to KT-56755 2023-02-20 08:40:34 +00:00
Dmitriy Novozhilov ae7863518d [Test] Mute tests due to KT-56508 2023-02-20 08:40:33 +00:00
Dmitriy Novozhilov 0d100cf114 [Test] Mute tests due to KT-53846 2023-02-20 08:40:33 +00:00
Dmitriy Novozhilov 49f15a16ce [Test] Mute tests due to KT-56760 2023-02-20 08:40:32 +00:00
Dmitriy Novozhilov 7c84f9a7c2 [Test] Mute test due to KT-56759 2023-02-20 08:40:32 +00:00