Commit Graph

109528 Commits

Author SHA1 Message Date
Ilya Goncharov 0ce7bdc837 [Gradle, Wasm] Fix compileSync input for production binary
^KT-66228 fixed
^KT-66159 fixed
2024-03-05 10:27:43 +00:00
Alexander Udalov 77b3f415a5 IR: fix "most specific" check in IrFakeOverrideBuilder
There were several problems with it:

1) `isMoreSpecific` should return true if a == b. Otherwise
   `isMoreSpecificThenAllOf` would never return true because it's always
   invoked with a collection that contains the candidate. K1 behaves
   similarly, `OverridingUtil.isMoreSpecific` returns true if a == b.
   So in fact, "more" should be understood as "not less" here.
2) `transitivelyMostSpecificMember` in `selectMostSpecificMember` was
   always equal to the first element, so `isMoreSpecific` was invoked
   with incorrect arguments.
3) At the end of `selectMostSpecificMember`, we selected the first
   candidate with the non-flexible return type, however only dynamic
   type was considered. We need to check `isFlexible` via type system
   instead.

 #KT-66120 Fixed
2024-03-05 09:19:38 +00:00
Dmitriy Novozhilov a08df1821f [FIR] Provide suppression from primary value parameter to property
`@Suppress` annotation has `VALUE_PARAMETER` target, so when a property
  in the primary constructor is annotated with `@Suppress` it sticks
  to the parameter. But the suppression should work for all diagnostics
  reported on the parameter **and** the property

^KT-66258 Fixed
2024-03-05 07:59:26 +00:00
Dmitriy Novozhilov 5e742884de [Test] Reproduce KT-66258 2024-03-05 07:59:26 +00:00
Kirill Rakhman 172df04c9b [FIR] Fix raw type nullability computation
Consider the nullability of the type arguments, not of the type.
This fixes a false positive ARGUMENT_TYPE_MISMATCH.

#KT-66294 Fixed
2024-03-05 07:45:01 +00:00
Dmitriy Novozhilov df878918ee [FIR] Optimize memory consumption of KtPsiSourceElement
There were two lazy properties in `KtPsiSourceElement`, which were
  rarely computed, which led to the fact that source element retained
  a lot of memory for those lazy delegates

^KT-66172 Fixed
2024-03-05 07:03:35 +00:00
Alexander Udalov 19cc7981dc Update test data for IR text tests 2024-03-05 06:59:11 +00:00
Alexander Udalov 3bb2ea10b6 K2: add inline JVM target version checker
#KT-60777 Fixed
2024-03-04 22:25:36 +00:00
Alexander Udalov d475371394 FIR: remove default parameter values from FirJvmSessionFactory
Most of them are passed at all call sites anyway. Having default values
makes it easy to forget to pass some meaningful argument (especially
`LanguageVersionSettingsImpl.DEFAULT` seems scary), and complicates
refactoring.
2024-03-04 22:25:36 +00:00
Alexander Udalov bacb2f0d15 K1 JVM: simplify InlinePlatformCompatibilityChecker 2024-03-04 22:25:36 +00:00
Vyacheslav Gerasimov 596aab1673 Build: Increase max metaspace size for Codegen Tests
#KTI-1610
2024-03-04 22:12:24 +00:00
Vyacheslav Gerasimov c3ab87f52b Build: Use reservedCodeCacheSizeMb in test process heap size calculation
#KTI-1609
2024-03-04 22:12:24 +00:00
Vyacheslav Gerasimov 93e8b18cde Build: Limit default max metaspace for test processes
Some test proceses grow much bigger than max heap size. Metaspace also
should be limited to avoid OOM Killer events.

 #KTI-1609
2024-03-04 22:12:24 +00:00
Alexander Shabalin 4e6451c25e [K/N] Use @Escapes for all external funs with escaping arguments 2024-03-04 21:04:04 +00:00
Alexander Shabalin 8d81fd6647 [K/N] Include frameworks via umbrella headers only ^KT-65409 2024-03-04 20:53:05 +00:00
Vladimir Dolzhenko ca88e6e834 Try to acquire LC lock with a smaller time window with checkCancels
#KTIJ-28688


Merge-request: KT-MR-14735
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-03-04 16:57:32 +00:00
anzhela.sukhanova 82255d5ee8 [Test] KT-61360: add tests for the IrFakeOverrideBuilder
Add tests for fake overrides with focus on java interoperability

Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
2024-03-04 16:21:02 +00:00
Artem Kobzar 30aae741a6 [K/Wasm] Fix DROP location 2024-03-04 15:05:23 +00:00
Artem Kobzar 4b57f38e4e [K/JS] Regenerate tests after merging two different changes into TS generator 2024-03-04 14:40:40 +00:00
Pavel Kunyavskiy 8d725753f8 [Fir2IR] Don't build overrides for expect classes.
We don't need them except for checking.
And checking doesn't work in any reasonable way anyway.

^KT-65249 Fixed
2024-03-04 14:12:48 +00:00
Wojciech Litewka baaaf4567e [IR] Convert methods in IrConstantValue classes to extension functions
to get rid of custom logic inside generated classes.

#KT-65773 In Progress
2024-03-04 14:07:06 +00:00
Wojciech Litewka 42668e2bf6 [IR] Remove IrFactory property from IrBlockBody and IrExpressionBody
in effort to simplify implementation classes when possible.

Those two properties always point to IrFactoryImpl, so it may as well
be used directly.

#KT-65773 In Progress
2024-03-04 14:07:06 +00:00
Wojciech Litewka 49db500369 [IR] Drop IrErrorCallExpressionImpl.addArgument
It was a remnant from the original IR implementation.

#KT-65773 In Progress
2024-03-04 14:07:06 +00:00
Wojciech Litewka 4c7c123fe8 [IR] Drop IrSyntheticBodyImpl.toString
It was the only IrElement with custom toString. And there is
a pending MR, which will override toString in IrElementBase, so this one
would be useless.

#KT-65773 In Progress
2024-03-04 14:07:06 +00:00
Brian Norman 8320668485 [FIR] Adding a test case to show resolution of KT-29559 in K2 2024-03-04 13:34:04 +00:00
Stanislav Ruban 2de0e4b8d2 [FIR][checkers] Respect ClassKind.INTERFACE in FirRegularClass.canHaveAbstractDeclaration
A Kotlin interface can have abstract members regardless of its modality. However, this invariant was previously ignored by FIR checkers. As a result, false-positive `ABSTRACT_<MEMBER>_IN_NON_ABSTRACT_CLASS` errors were being reported in explicitly non-abstract interfaces.

This commit makes a relevant FIR utility used by relevant FIR checkers aware of the aforementioned invariant.

#KT-66260 Fixed
2024-03-04 12:00:18 +00:00
Stanislav Ruban e0b83def00 [tests] Add test data for KT-66260 2024-03-04 12:00:18 +00:00
cristiangarcia 306c7f4b03 Dokka is not compatible with ConfigurationCache (kotlin-stdlib-docs)
Required for KTI-1553
2024-03-04 11:40:28 +00:00
Ilya Gorbunov f44ab4676f [docs] Update Gradle version and wrapper in legacy docs build 2024-03-04 11:40:28 +00:00
Ilya Gorbunov caee1a9b2b [docs] Use env variable to detect teamcity build mode
Checking property 'teamcity.version' no longer works with the way
TC passes parameters when configuration cache is enabled.
2024-03-04 11:40:28 +00:00
Ilya Gorbunov 7cc2384485 Remove kotlin-stdlib-common exclusion
It's no longer a transitive dependency of kotlin-stdlib
2024-03-04 11:40:06 +00:00
Ilya Gorbunov 35bca103eb [stdlib-mpp] Single dependency on stdlib in commonMain
In this project it's required to declare stdlib dependency explicitly,
but now it can be a single line in commonMain
2024-03-04 11:40:06 +00:00
Ilya Gorbunov 16e61f978c [stdlib-mpp] remove some kotlin-stdlib-common artifact deps 2024-03-04 11:40:06 +00:00
Sergey Bogolepov 35579692d9 [Swift export] Move swift-export-standalone tests
Move them under `nativeCompilerTest` for the sake of unification, and
running under proper CI configuration.
2024-03-04 08:57:32 +00:00
Nikita Klimenko 42cc181fa0 [FIR Plugin prototype] Implement DataFrame-like extension
Proof of concept that FirFunctionCallRefinementExtension (new) and
existing extension points can be used together to update the return type
of the specific calls and generate members based on call arguments.

Important implementation details:
- FirDeclarationGenerationExtension must be used to generate members of
generated local classes.
- FirExtensionSessionComponent together with firCachesFactory to pass
information between `intercept` and `transform`

Actual plugin is developed as a part of Kotlin dataframe repository

KT-65859
2024-03-04 06:33:24 +00:00
Nikita Klimenko c49edfef04 [FIR] Extension point for function calls
This extension point allows changing the return type of call
 from a declared type to its subtype.
With an idea that such a plugin needs the ability to
control available (extension) properties for this type.
A set of properties should be decided based on the resolved function,
provided arguments, types, and resolved lambdas.
It is not a goal to enable plugins to affect resolution in any way.
Types are not intended to have any structured capabilities

In other words.
The goal was to come up with a way to enable a limited form
of an "extensible records" mechanism through plugins.
- It should give enough value for a practical use.
(more info in the ticket).
- It should have minimal effect on the compilation process
This appears to be an extension point that solves this problem.

^KT-65859 Fixed
2024-03-04 06:33:24 +00:00
Dmitrii Gridin 4d04546652 [FIR] FirPlatformDeclarationFilter: add missed lazy resolve call
`isFunctionAvailable` can be called from `PlatformDependentFilteringScope`
on unresolved declarations during `STATUS` phase

^KT-66268 Fixed
2024-03-03 22:00:06 +00:00
Vladimir Sukharev 90aeac945d [K/N][Tests] Support IGNORE_NATIVE and DISABLE_NATIVE in StandardTestCaseGroupProvider
^KT-61259
2024-03-02 08:38:10 +00:00
Dmitrii Gridin f844b87f75 [LL FIR] FirElementBuilder: do nothing for KtAnnotation
We shouldn't try to find FIR for such elements as they just don't
exist in FIR

^KT-65780
2024-03-01 19:19:00 +00:00
Dmitrii Gridin 62ec189924 [LL FIR] add getOrBuildFir for KtAnnotation
^KT-65780
2024-03-01 19:19:00 +00:00
Dmitrii Gridin 16878ca20d [LL FIR] FirElementBuilder: support KtAnnotation in file annotations
^KT-65780
2024-03-01 19:19:00 +00:00
Dmitrii Gridin ba92fc97f9 [LL FIR] add test on annotation with [] syntax
^KT-65780
2024-03-01 19:19:00 +00:00
Dmitrii Gridin 17c128adf2 [FIR] get rid of FirFileAnnotationsContainer
This element has been introduced to simplify resolution logic in LL FIR,
but now this element is redundant and only complicates the code as after
KT-56683 `FirFile` has real phases

^KT-65876 Fixed
2024-03-01 19:19:00 +00:00
Pavel Punegov 24c91bbf56 [K/N] XCTest runner test arguments processing
Get test arguments from the process arguments and environment.
There is the following order to get args:
1. Get from the process arguments.
2. If no arguments are specified, try to use process environment.
3. Get the KotlinNativeTestArgs key from the Info.plist.

Part of the ^KT-58928
2024-03-01 18:39:16 +00:00
Dmitrii Gridin 42a982b400 [LL FIR] move Lincheck tests out of Low Level API FIR Tests
They take too much time and block other tests
2024-03-01 17:29:07 +00:00
Mikhail Glukhikh 75ecba5a4a Tests/PCLA: extend the test for KT-55168
#KT-55168 As Designed
2024-03-01 17:02:49 +00:00
Alexander Udalov fc9aacfde3 Minor, add test for issue fixed by IrFakeOverrideBuilder
Fixed by f98a22e8e4 (KT-61514).

 #KT-66000 Fixed
2024-03-01 14:19:27 +00:00
Kirill Rakhman bb6091cc90 [Tests] Add regression test for #KT-66158 2024-03-01 14:08:39 +00:00
Kirill Rakhman 5bca945d05 [FIR] Fix nullability of types produced by ConeRawScopeSubstitutor
#KT-66067 Fixed
2024-03-01 14:08:39 +00:00
Vladimir Sukharev b6a6b12f0f [K/N][Tests] Rename compileToExecutable to reflect its one-staged behavior
^KT-66014
2024-03-01 13:53:38 +00:00