110149 Commits

Author SHA1 Message Date
Alexander Udalov 88d159ec65 IR: minor, update the comment about K2 kapt in IrGenerationExtension
K2 kapt does use stub generation in the end after all, but using the
analysis API instead of the IR backend.
2024-03-15 14:32:39 +00:00
Nataliya.Valtman 76d555e5d6 Add FUS metrics for power-assert compiler plugin usage
#KT-63619: Fixed
2024-03-15 13:53:50 +00:00
Ilya Goncharov 8a9fb7d954 [Wasm] Print result of webpack and webpack process not into error log level, print everything from webpack to info log
^KT-64601 fixed
2024-03-15 13:32:45 +00:00
Anton Lakotka 2880082c9a [Gradle] Test for KLIB manifest in CompositeMetadataArtifactImpl
This should protect from cases when CompositeMetadataArtifact got
polluted due to some bugs or user misconfiguration.

One of the cases is when resource file is added to common source set.
In this case due to KT-66563 bug, resources will be mixed in to the
KLIB content. But if for some source set there is no sources.
Then in composite metadata artifact will be only the resources.
And previous implementation of CompositeMetadataArtifactImpl treated
that content as Metadata KLIB, however the metadata compiler didn't.
And thus it was failing with. This change makes it stricter.

Now it checks for `default/manifest` entry. This entry is considered
a sane check for KLIB content.

^KT-65315 Verification Pending
2024-03-15 13:13:47 +00:00
Anton Lakotka 322940f228 [Gradle] Test that composite metadata artifact with resources only...
...doesn't fail metadata compilation of depending projects.

^KT-65315
2024-03-15 13:13:47 +00:00
Alejandro Serrano Mena a18dca5728 Add missing cases for PROPERTY_AS_OPERATOR 2024-03-15 12:52:10 +00:00
Nataliya.Valtman 869cc8bdb8 Do not run FusStatisticIT.testProjectWithIncludedBuild test on windows
#KT-65227
2024-03-15 12:50:58 +00:00
Kirill Rakhman 2095f90e69 [FIR] Fix exception in Java scope caused by inherited member with implicit return type
It's caused by checking the return type of an inherited property.
toConeKotlinTypeProbablyFlexible() returns an error type when the
type ref is unresolved instead of throwing.
This "breaks" some override checks and in the added test, it leads
to an additional candidate being created for a synthetic property.
However, the candidate has applicability K2_SYNTHETIC_RESOLVED
and gets filtered out because the real property has a higher
applicability.

#KT-66392 Fixed
2024-03-15 12:01:55 +00:00
Stanislav Ruban 8f420eb3e1 [FIR][checkers][Wasm] Turn FirWasmJsInteropTypesChecker into a platform checker
#KT-66475 Fixed
2024-03-15 11:40:55 +00:00
Stanislav Ruban 478c1a6d50 [FIR][checkers][JS] Move reporting of FirJsErrors.EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE to FirJsInheritanceClassChecker
#KT-66474 Fixed
2024-03-15 11:40:55 +00:00
Stanislav Ruban 0549c6c75b [FIR][checkers][Wasm] Expand type aliases in FirWasmExternalInheritanceChecker
#KT-66473 Fixed
2024-03-15 11:40:55 +00:00
Stanislav Ruban 4d17a908e2 [tests][FIR][checkers][Wasm] Add test data for KT-66475 2024-03-15 11:40:55 +00:00
Stanislav Ruban bf77cc3d0c [tests][FIR][checkers][JS] Add test data for KT-66474 2024-03-15 11:40:55 +00:00
Stanislav Ruban 41e8b45def [tests][FIR][checkers][Wasm] Add test data for KT-66473 2024-03-15 11:40:55 +00:00
Stanislav Ruban 24d7d8088c [tests][FIR][checkers][Wasm] Prepare for addition of KMP Wasm test data 2024-03-15 11:40:55 +00:00
Stanislav Ruban a7332a4cad [minor][FIR][checkers][Wasm] Refactor FirWasmJsInteropTypesChecker for readability 2024-03-15 11:40:55 +00:00
Stanislav Ruban 4dd0a25eca [FIR][checkers][Wasm] Refine WRONG_JS_INTEROP_TYPE reporting
This commit improves four aspects of WRONG_JS_INTEROP_TYPE error reporting:
1) more precise source code ranges are preferred when possible (e.g. value parameter type instead of the entire value parameter, explicit return type instead of the entire declaration, etc.)
2) only relevant parameter and return types of function types are reported as wrong (to prevent confusion with the "function types are supported" part of the error message)
3) WRONG_JS_INTEROP_TYPE errors are now deduplicated in cases where more than one such error was previously reported because of compiler-generated declarations
4) error messages were slightly proofread and contain slightly more information now
2024-03-15 11:40:55 +00:00
Stanislav Ruban a65ea2ce02 [FIR][checkers][Wasm] Reorder information in messages for WRONG_JS_INTEROP_TYPE 2024-03-15 11:40:55 +00:00
Stanislav Ruban b165ff675b [tests][FIR][checkers][Wasm] Improve test coverage for WRONG_JS_INTEROP_TYPE 2024-03-15 11:40:55 +00:00
Artem Olkov eaa50fbf37 add export from kotlin into swift of simple documentation comment #KT-65913 fixed
Merge-request: KT-MR-14622
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-03-15 11:40:13 +00:00
Mikhail Glukhikh 11c006d14c Fix result in JavaUsageTest (poisoning is now OFF) 2024-03-15 11:33:10 +00:00
Mikhail Glukhikh c6e0268893 Revert "Temporary: make PRE_RELEASE_CLASS a warning in both K1/K2 (KT-66551)"
This reverts commit a0cb713d19.
#KT-66551 Fixed
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh 8ac576614f Revert "Temporary: mute PRE_RELEASE_CLASS in some tests (KT-66551)"
This reverts commit 893e5cac
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh e22a2016b1 Revert "Temporary: make "Pre-release classes were found in dependencies" warning"
This reverts commit 92cf3e3343.
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh 6d02ce601a Revert "Temporary: mute pre-release warnings in Gradle tests (KT-66551)"
This reverts commit 0757247233.
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh a8bac70dec Revert "Temporary: comment the last check in JavaUsageTest (KT-66551)"
This reverts commit f2ec6d7495.
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh 09eb138625 Revert "Temporary: don't check log in Maven test (KT-66551)"
This reverts commit 95fa065361.
2024-03-15 11:33:10 +00:00
Vyacheslav Gerasimov 4f4f6393f9 Build: Introduce kotlin.build.test.process.NativeMemoryTracking property
Used to set `-XX:NativeMemoryTracking` for test processes

 #KTI-1609
2024-03-15 11:18:20 +00:00
Johan Bay cf2135aaa4 [K/N] skip lowerings for header caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay d845e7c3f6 [K/N] skip consistency check for header caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay 612caf13cf [K/N] do not save klib hash in header caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay 1f1522b787 [K/N] remove class field types from caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay a481f35450 [K/N] deserialize inline functions for header klibs
For header klibs the indices in the cache for the function bodies
are wrong so we instead deserialize the inline functions up-front.
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay 59f0c0464b [K/N] add flag to klib manifest for header klibs
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay 1b521d564f [K/N] serialize field names to caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay a89893a2c5 [K/N] add testing setup for header klibs and caches
^KT-65443
2024-03-15 10:24:26 +00:00
Johan Bay 84341a9e25 [K/N] add header_cache output type
^KT-65443
2024-03-15 10:24:25 +00:00
Roman Golyshev d8ae22e824 KTIJ-29015 [Plugin API] Add documentation to the ExtensionStorage.registerDisposable 2024-03-15 09:56:13 +00:00
Mikhail Glukhikh 40c4e865c7 K2/Java/enhancement: implement wildcards replacement with flexible bounds
This commit in fact changes two very related places:
- first, it implements forgotten 'enhancedForWarnings' in K2 enhancement
- second, it repeats KT-48515 fix for K2 while enhancing wildcards

#KT-65594 Fixed
Related to KT-48515, KT-63746
2024-03-15 09:40:54 +00:00
Mikhail Glukhikh 5b0cb5c9db K2/jspecify: reproduce KT-65594 2024-03-15 09:40:53 +00:00
Dmitriy Novozhilov 30e2af7b66 [FIR] Threat some error candidate applicabilities with same priority
There is a thing that `CandidateCollector` adds error candidate to the
  list of resulting candidates only if its applicability at least the
  same as current applicability of the collector

Also there is a problem, that deserialized symbol provider in CLI compiler
  and stub-based symbol provider in AA may return the same declarations
  in different order. This provokes the difference in the resulting set
  of candidates between the two modes:

```
val x by unresolved
```

During the resolution of this code compiler tries to find function `getValue`,
  and there are 6 of them in the stdlib. From them we are interseted in
  specific three:

1. `fun <K, V> Map<K, V>.getValue(key: R|K|): R|V|`
2. `inline operator fun <V, V1 : V> Map<in String, @Exact V>.getValue(thisRef: Any?, property: KProperty<*>): V1`
3. `inline operator fun <V, V1 : V> MutableMap<in String, out @Exact V>.getValue(thisRef: Any?, property: KProperty<*>): V1`

- (1) is inapplicable with `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR`
- (2) and (3) are inapplicable with `INAPPLICABLE_WRONG_RECEIVER`
- `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR` is more specific applicability than `INAPPLICABLE_WRONG_RECEIVER`
- CLI compiler always sees those functions in order 1 -> 2 -> 3
- AA providers sometimes returns them in order 2 -> 3 -> 1

So in CLI compilation candidates (2) and (3) are not added to the resulting
  set, as they are "less applicable" than (1), but in AA compilation they
  can be added to the set before (1), which causes sporadic change in
  FIR dump of `unsafeAssignmentExtra.kt`

To workaround this problem it was decided to treat `INAPPLICABLE_ARGUMENTS_MAPPING_ERROR`
  and `INAPPLICABLE_WRONG_RECEIVER` applicabilities as "equally specific"

^KT-65218 Fixed
2024-03-15 08:21:42 +00:00
Alexander Shabalin d88092aa94 [K/N][tests] Migrate various runtime/ tests ^KT-61259 2024-03-15 01:28:01 +00:00
Sergej Jaskiewicz 7ad4e58a7a [FIR tree generator] Add a kDoc for FirUnitExpression 2024-03-14 23:19:40 +00:00
Sergej Jaskiewicz c379fd7fa1 [tree generator] Allow adding kDocs to implementation classes 2024-03-14 23:19:40 +00:00
Mikhail Glukhikh cd20f31810 K2: introduce JavaTypeParameterDefaultRepresentationWithDNN exp. feature
#KT-66447 Fixed
2024-03-14 22:39:03 +00:00
Christian Melchior 4464385fa9 Scripting: KT-62576 Remove irrelevant output from classpath debug information.
Merge-request: KT-MR-14868
Merged-by: Christian Melchior <christian.melchior@jetbrains.com>
2024-03-14 20:52:27 +00:00
Alevtina.Gamzikova 7d06b34bfa [Test] KT-64350 Add testcases 2024-03-14 20:41:53 +00:00
Jaebaek Seo 90ccdb79ed K2: Set special function kind to function param with receiver
`StubBasedFirTypeDeserializer` handles function parameter with a
receiver with a special exception, which sets it as
`ExtensionFunctionType`, but skips setting special function kinds for it
even when the function parameter type is a special function kind. This
drops `Composable` annotation from a lambda expression if the function
parameter taking the lambda expression as an argument has a receiver,
which causes a severe CodeGen error for Compose app on K2 Android
Studio.

^KT-66526 Fixed
2024-03-14 20:08:24 +00:00
Dmitriy Novozhilov cc6e0eb218 [Test] Unmute passing test about binary poisoning (KT-66551) 2024-03-14 19:53:25 +00:00
Dmitriy Novozhilov e89afe8f6b Advance bootstrap to 2.0.0-dev-18803 2024-03-14 19:53:25 +00:00