Commit Graph

108516 Commits

Author SHA1 Message Date
Dmitrii Gridin 9b60e5ca06 [LL FIR] adapt RawFirNonLocalDeclarationBuilder for new FirDesignation
Effectively nothing changed right now, but now it is possible to process
`FirScript` as `containingDeclaration` inside `moveNext`

^KT-65345
2024-02-05 09:32:45 +00:00
Dmitrii Gridin eb8e3f64f0 [LL FIR] reuse FirDesignation for LLFirResolveTarget
This is an intermediate change before unification

^KT-65345
2024-02-05 09:32:45 +00:00
Dmitrii Gridin 39131a7f30 [LL FIR] rework FirDesignation collector
The main change – now we collect not only `FirRegularClass`, but also
`FirScript`.
This allows us to have a proper context collector for
diagnostics for scripts.
Also, this change fixes dangling files for scripts in `IGNORE_SELF`
as now we have the correct patcher for this case, so we won't resolve
the copied script

^KT-65345
^KT-62841 Fixed
2024-02-05 09:32:45 +00:00
Dmitrii Gridin f06b17cbb2 [LL FIR] unify FirDesignation
Now we have only one FirDesignation instead of `FirDesignation`,
`FirDesignationWithFile` and `FirDesignationWithScript`

This allows us to unify situations with `FirFile` and `FirScript`
in the path and unbind from `FirRegularClass`.
This commit only refactors code, the semantic is still the same yet

^KT-65345
2024-02-05 09:32:45 +00:00
anzhela.sukhanova 14b6f6d050 [Test] KT-59012: tests for inferring types based on self upper bound
Add tests on JK inheritance cases, extension functions for Enum and some basic recursive type cases
2024-02-05 09:05:13 +00:00
Mikhail Glukhikh e1df52bc02 K2: handle non lookup-tag based types in private-to-this analysis
#KT-62134 Fixed
2024-02-02 17:12:02 +00:00
Mikhail Glukhikh 3c3396a87e K2: reproduce some situations related to KT-62134 2024-02-02 17:12:02 +00:00
Mikhail Glukhikh 36dd9b6818 K2: add BB tests for KT-59380 working properly (compiler error in K1)
#KT-59380 As Designed
2024-02-02 17:07:40 +00:00
Vladimir Tagakov dab9ac3b1c jvm-abi-gen: Allow disabling class members sorting in abi.jar
#KT-64589
2024-02-02 16:29:19 +00:00
Pavel Kunyavskiy c0152ccf0f [IRFakeOverrides] Convert lazy callables overriddens during f/o building
Unfortunately, it's not enough to know direct overriddens
to correctly build fake overrides. This mean, that we need to know
whole overridden tree during the process of building.

It happens automatically for normal classes, but not for lazy classes,
as their overriddens are built separatly.

This commit enforces correct overrddens for lazy classes in hierarhies
at the point, where they should be normally computed.

^KT-65236
2024-02-02 16:28:25 +00:00
Pavel Kunyavskiy caa6918031 [FIR2IR] Fix handling private setters in anonymous classes
^KT-65290 Fixed
2024-02-02 16:07:35 +00:00
Denis.Zharkov 66d8f471d9 K2: Fix internal error in FIR2IR caused by PCLA + String interpolation
There's an implicit contract in PCLA that the statement-level call
should be postponed iff it has something to be postponed inside.

And that contract didn't work well for string interpolation containing
some postponed calls.

Thus, we haven't run a completion results writing for them properly,
thus leaving type parameters (K from synthetic call) for expression
types instead of an inferred substituted type.

In this commit, the contract was reversed to explicitly enumerate
the cases when it's safe to resolve the candidate outside PCLA session.

See the comments at `mightBeAnalyzedAndCompletedIndependently`.

^KT-65341 Fixed
2024-02-02 15:40:47 +00:00
Denis.Zharkov 3ba8256b8d Add IR text tests fixating the state of KT-65341 2024-02-02 15:40:46 +00:00
Denis.Zharkov 64902e615e K2: Minor. Unify call postponement rules in PCLA session 2024-02-02 15:40:46 +00:00
Yan Zhulanow 57dcd645b1 [kotlin] Reuse applicability checker between extension candidates
Before, auto-completion was based on on-air resolve, and
'FirTowerDataContext' was computed once, during creation of the
dependent analysis session (with using 'FirTowerDataContextCollector').
This allowed to return the context almost instantly, no matter how many
completion candidates there were.

Dangling file resolution doesn't use 'FirTowerDataContextCollector', as
now there is more precise 'ContextCollector'. However,
'ContextCollector' doesn't cache results by itself, and, if asked, it
will compute the same context over and over again. This exact happened
with extension applicability checker.

The optimized implementation maintains a checker object which caches the
computed context. The old end-point is left to give the IDE plugin time
to adapt to the change.

^KTIJ-28445
2024-02-02 15:38:10 +00:00
Artem Kobzar 4f521aa05c [K1] Fix string offsets to include quotes in the same way it's done in FIR 2024-02-02 14:43:46 +00:00
Anastasia.Nekrasova 434470a4f5 [K/N][K2]: K2 behavioral difference with inconsistent inheritance of ObjCName
The problem arises when retrieveDirectOverriddenOf returns a
substitution override member. For such members, it is impossible to get
the first base member. For a correct result, it is required to find
originalForSubstitutionOverride for all substitutionOverrides.

#KT-64276 Fixed
2024-02-02 13:54:45 +00:00
Alexander Shabalin 5525a6829a [ObjCExport][tests] Ignore AA test failures both locally and on CI
To run AA tests normally, use kif.loca gradle property.


Merge-request: KT-MR-14129
Merged-by: Alexander Shabalin <alexander.shabalin@ashabalin.me>
2024-02-02 13:43:30 +00:00
Kirill Rakhman 15d2799ed4 Update dependency verification metadata 2024-02-02 13:26:57 +00:00
Kirill Rakhman 4ef69e198c Advance bootstrap to 2.0.0-dev-14242 2024-02-02 13:26:57 +00:00
Bogdan Mukvich cb8228d6ec Add testRuntimeClasspath to resolveDependencies task 2024-02-02 13:26:57 +00:00
Dmitrii Krasnov 2873b11589 [Gradle] Muted k/n IT tests on Windows
connected with this problem ^KT-62761
2024-02-02 11:44:03 +00:00
Dmitrii Krasnov d4a4696baf [Gradle] Added dependencyManagement as to Integration Tests
Also fixed found problems with k/n toolchain feature

^KT-64903 Fixed
2024-02-02 11:44:03 +00:00
Artem Kobzar 4b1bbefe05 [Plugin JS Plain Objects] Remove wasm support because there is no possibility to eliminate inlined js object properties at this moment 2024-02-02 10:38:13 +00:00
Kirill Rakhman d937fb4350 [FIR] Fix exception in scopes caused by property and extension property with the same name in KJK hierarchy
#KT-65373 Fixed
2024-02-02 08:51:10 +00:00
Nikolay Lunyak 9688865953 [FIR] Check the presence of delegated constructor call via stubs
After `4b8b7aaa` external classes' secondary
constructors should not have a delegated call, so we
don't create a call if there's no explicit call.
But we need to check if there is.

The failing tests were muted in
`8fcf91d8`, and are now unmuted
back. Those are the ones in the
`testData/rawBuilder/declarations`
folder. These tests fail because they supply
PSI stubs for the secondary constructors,
so arbitrary operations (like reading .text of
the delegated constructor call) are not allowed
for them. This commit modifies secondary
constructor stubs to include the
required information.

^KT-65268 Fixed


Merge-request: KT-MR-13982
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2024-02-02 08:15:54 +00:00
Alexander Udalov 77dba281a3 CLI: remove obsolete -Xbuiltins-from-sources
Looks like it has no effect anymore after 3f2e996803.
2024-02-01 23:37:23 +00:00
Alexander Udalov 2d308e7c27 CLI: remove obsolete language feature arguments
These arguments switch language features which cannot be disabled
anymore because they're enabled from some LV not later than 1.4, and the
minimal supported LV is currently 1.4.
2024-02-01 23:37:23 +00:00
Alexander Udalov c2e67619ba CLI: remove obsolete -Xdisable-ultra-light-classes 2024-02-01 23:37:23 +00:00
Alexander Udalov 9d5e1bdc47 CLI: remove obsolete -Xallow-result-return-type 2024-02-01 23:37:23 +00:00
Alexander Udalov 49c659b379 CLI: remove obsolete -Xdump-declarations-to
It was only used in the very old version of binary compatibility
validator. It was never supported in the JVM IR backend.
2024-02-01 23:37:23 +00:00
Alexander Udalov d450e3074b IR: do not build fake overrides for static members of interfaces
Split members into static/non-static, and only build fake overrides for
inherited static members of classes.

 #KT-65276 Fixed
 #KT-65277 Fixed
2024-02-01 23:25:50 +00:00
Alexander Udalov b28339e8bc IR: do not build fake overrides for static members if not needed
This is kind of another fix for KT-65456, independent from the one in
the previous commit. Here we restore the old behavior of
`buildFakeOverridesForClassUsingOverriddenSymbols`, which is used in
places where fake overrides for static declarations from
superclasses are not necessary at all, such as SAM adapters or
annotation implementation classes.
2024-02-01 23:25:49 +00:00
Alexander Udalov a22c16e745 IR: do not assert presence of property getter in IrFakeOverrideBuilder
#KT-65456 Fixed
2024-02-01 23:25:49 +00:00
Alexander Udalov b752d3997b Reapply "[IrFakeOverrideBuilder] Support fake overrides for java static methods"
This reverts commit 6271f5cbe5.

The original commit 15094eb03a was reverted because it caused a problem
during bootstrap. That problem is fixed in a subsequent commit.
2024-02-01 23:25:48 +00:00
Alexander Udalov 3d2d2af60c Fir2Ir: wrap IrFakeOverrideBuilder call with try-catch
To add the file name to the exception message similarly to how it's done
in `PerformByIrFilePhase.invokeSequential`, so that exceptions such as
KT-65277 would be easier to diagnose.
2024-02-01 23:25:48 +00:00
Alexander Udalov 9e2c7ce1e1 IR: minor, add toString to MemberWithOriginal and FakeOverride
To make it easier to debug.
2024-02-01 23:25:48 +00:00
Marco Pennekamp eb6f30dcd4 [LL] Update stub-based deserialization of enum entry annotation arguments
- This mirrors the changes to `AbstractAnnotationDeserializer` in the
  scope of KT-64975.

^KT-63330 fixed
^KT-64975
2024-02-01 20:26:58 +00:00
Marco Pennekamp a38d613dc3 [LL] Add getOrBuildFir test for deserialized enum entry annotation argument
- The `getOrBuildFir` test clearly shows the difference between the
  unresolved enum entry and the resolved one (see the next commit).

^KT-63330
2024-02-01 20:26:58 +00:00
Marco Pennekamp acf828621a [LL] Support SKIP_WHEN_OUT_OF_CONTENT_ROOT in multi-module out-of-content-root tests containing library modules
- If we don't override `createModules`, library module creation will
  fail with an exception before `SKIP_WHEN_OUT_OF_CONTENT_ROOT` is ever
  checked.
- I don't think it makes sense to add library compilation support to
  out-of-content-root tests, since out-of-content-root files should not
  be able to depend on any library.

^KT-63330
2024-02-01 20:26:58 +00:00
Artem Kobzar 2fdc8b6c14 [K/Wasm] Refactor the fix for the non-capturing lambda singletons 2024-02-01 18:13:37 +00:00
Ivan Kochurkin 968ecadff2 [FIR2IR] Erasure type of parameter of delegated property in K1 manner
Add `shouldEraseType` to `Fir2IrConversionScope`

^KT-62884 Fixed
2024-02-01 15:36:32 +00:00
Ivan Kochurkin e55acf56fa [FIR2IR] Add Fir2IrConversionScope to Fir2IrClassifierStorage and Fir2IrConverter
Use `withContainingFirClass` during processing `localClassesCreatedOnTheFly`

Use `withContainingFirClass` in `processLocalClassAndNestedClassesOnTheFly` and `processLocalClassAndNestedClasses`
2024-02-01 15:36:32 +00:00
Pavel Kunyavskiy 24f8da471f [FIR] Fix handling fake overrides in override visibility check
^KT-65432
2024-02-01 13:46:15 +00:00
Artem Kobzar 61f14374b9 [Gradle JS/Wasm] Force CLI arg usage in case of debug property for the Webpack DevServer 2024-02-01 11:00:19 +00:00
Alexander Shabalin 0a4262d3ff [K/N][tests] Nonfatal timeout on draining streams on Windows ^KT-65113 2024-02-01 10:59:04 +00:00
Roman Golyshev a55b8d30fd KT-65425 [SLC] Correctly compute getQualifiedName for generated classes
Since the declarations generated by compiler plugins do not have proper
PSI (`classOrObjectDeclaration` in this case), we need to resort to
symbols for such declarations to compute the proper qualified name

^KT-65425 Fixed
2024-02-01 10:14:20 +00:00
Kirill Rakhman 6271f5cbe5 Revert "[IrFakeOverrideBuilder] Support fake overrides for java static methods"
This reverts commit 15094eb03a.
2024-02-01 08:43:00 +00:00
Iaroslav Postovalov 7c4e43938b [Tests] Add custom JVM target tests for K2
^KT-59630 Fixed
2024-02-01 06:25:07 +00:00
Brian Norman dde2156f5f [FIR2IR] Always use property type if var
For destructing calls, the component type is used for the property type
in all cases. However, this can result in runtime and/or compilation
errors when the property is a var and changed, especially when the
component is a primitive but the property type is nullable. Instead,
only use the component type when the property is also a val.

^KT-64944 Fixed
2024-01-31 22:27:18 +00:00