Commit Graph

108497 Commits

Author SHA1 Message Date
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
Dmitriy Dolovov 1fe8b50c19 [Commonizer] Metadata comparator: treat type nullability properly
^KT-62753
2024-01-31 17:40:53 +00:00
Mikhail Glukhikh 7615d863d5 K2: add ACCIDENTAL_OVERRIDE_CLASH_BY_JVM_SIGNATURE for clashing functions
This diagnostic is reported on an explicitly-declared function which
overrides a regular Java function with the same signature as a hidden
one from the same scope.

#KT-64846 Fixed
2024-01-31 17:06:36 +00:00
Mikhail Glukhikh 8f9614c1fb K2: don't allow to override isHiddenToOvercomeSignatureClash to match K1
Related to KT-64846
2024-01-31 17:06:36 +00:00
Mikhail Glukhikh 3b164e560c JavaClassUseSiteMemberScope: add KDoc 2024-01-31 17:06:36 +00:00
Mikhail Glukhikh 49ec30735c K2: add a pair of KJ tests related to KT-64846 but w/out explicit override 2024-01-31 17:06:36 +00:00
Mikhail Glukhikh c0e0b4d32b K2/Java: cleanup code around processOverridesForFunctionsWithErasedValueParameter
#KT-64846 In Progress
2024-01-31 17:06:36 +00:00
Mikhail Glukhikh ac729e28da K2/Java: fix processing of built-in with value parameters to be erased in Java
In this commit we started to create and process a hidden copy
for a built-in functions, which value parameters are erased in Java,
in case we have an accidental Java override which value parameters
are not erased.

In this situation attempt to override such a Java override in Kotlin
again will lead to inaccessible functions
(see changes in containsAndOverload.fir.kt)

#KT-64846 In Progress
2024-01-31 17:06:35 +00:00
Mikhail Glukhikh 30ad532ff9 K2/tests: add a similar to containsAndOverload test about charAt / get
Related to KT-64846
2024-01-31 17:06:35 +00:00
Mikhail Glukhikh 005cda1f6e K2/tests: add scope dumping for tests related to KT-64846 2024-01-31 17:06:35 +00:00
Mikhail Glukhikh d0c78e5116 K2/tests: add /* hidden ... */ rendering to scope dumper 2024-01-31 17:06:35 +00:00
Xuan-Son Trinh f4f009cb9a [JPS] Fix KotlinJvmModuleBuildTarget.findJavaSourceRoots to only return Java source roots
This change is needed because otherwise, source files that are not Java will be added as `JavaSourceRoot`, this is incorrect and causes assertion error in `com.intellij.core.JavaCoreProjectEnvironment.addSourcesToClasspath`. Refer to KT-65325 for more context.


Merge-request: KT-MR-14088
Merged-by: Xuan Son Trinh <xuanson.trinh@jetbrains.com>
2024-01-31 16:52:42 +00:00
Nikita Bobko d69deb97fe K2: Put boolean DFA variables under a feature flag
^KT-62547 Fixed

I also tested the commit by disabling DfaBooleanVariables in all tests
and checking what tests will fail

I didn't find anything that worked in K1, but doesn't work in K2 with
DfaBooleanVariables disabled

Related tests:
- DiagnosticCompilerTestFirTestdataTestGenerated$Resolve$Smartcasts
- LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated$Resolve$Smartcasts
- PreFirIdeSpecTestGenerated$NotLinked$Dfa
- DiagnosticCompilerTestFE10TestdataTestGenerated$Tests$SmartCasts
- FirPsiDiagnosticTestGenerated$Resolve$Expresssions.testSyntheticSmartCast
2024-01-31 16:31:02 +00:00
Vladimir Sukharev 118a5cee06 [K/N][Tests] Cleanup tests code from old infra
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 2276abfb85 [K/N][Tests] Use GTest patterns for ignored tests
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 1ca79e645a [K/N][Tests] Use runProcess for code signing
^KT-61259
2024-01-31 16:17:21 +00:00
Vladimir Sukharev 524f0d335e [K/N][Tests] Migrate objcSmoke & objcTests tests
^KT-61259
2024-01-31 16:17:21 +00:00
Alexander.Likhachev 58f7dd1c83 [Daemon] Change default Kotlin daemon JVM options
Now, the Kotlin daemon enables parallel GC and uses code cache flushing by default. Also, the default reserved code cache size is adjusted.

^KT-64283 Verification Pending
2024-01-31 15:13:02 +00:00
Alexander.Likhachev dbdcce0655 [Daemon] Fix a typo in the jvm arguments 2024-01-31 15:13:02 +00:00
Kirill Rakhman 853ad54699 [FIR] Fix incorrect updating of callable reference type in delegated property
... if the delegate happens to be a function call whose second
argument is a callable reference but not actually a provideDelegate
call.
The fix is to ensure that the call is _actually_ a desugared
provideDelegate call.

This fixes a CCE in a case where the delegate expression is a regular
function call and the second argument is a callable reference.

#KT-65165 Fixed
2024-01-31 14:51:51 +00:00