Commit Graph

108487 Commits

Author SHA1 Message Date
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
Brian Norman fced126c9f [FIR] Properties defined in a do-while may not always be initialized
Local properties defined within the body of a do-while loop can be used
in the condition of the loop. However, use of a `continue` may mean the
property isn't always initialized, even if it is initialized when it is
defined. So while a local property may be within scope and has an
initializer, this doesn't always mean that the property is initialized.

As such, properties that are defined within a do-while loop and also
used in the condition of the same do-while loop should be tracked. Then,
these properties should still be checked for proper initialization even
if they have an initializer.

^KT-64872 Fixed
2024-01-31 13:37:30 +00:00
Igor Chevdar 4af8b70f62 [K/N][IR] Skip static fields in initializers lowering
#KT-65010 Fixed
2024-01-31 12:22:36 +00:00
Alexander.Likhachev 5c4fbcb623 [Gradle] Fix warnings in DefaultCInteropSettings
^KT-56904 In Progress
2024-01-31 12:20:06 +00:00
Alexander.Likhachev 839723e4de [Gradle] Fix warnings in KotlinCocoapodsPlugin
^KT-56904 In Progress
2024-01-31 12:20:06 +00:00
Alexander.Likhachev 8833193349 [Gradle] Fix warnings in GenerateArtifactPodspecTask
^KT-56904 In Progress
2024-01-31 12:20:05 +00:00
Alexander.Likhachev de504c9e93 [Gradle] Fix warnings in KotlinCompilationNpmResolution
^KT-56904 In Progress
2024-01-31 12:20:05 +00:00
Alexander.Likhachev 4de2f7ef27 [Gradle] Fix warnings in KotlinRootNpmResolver
^KT-56904 In Progress
2024-01-31 12:20:05 +00:00
Alexander.Likhachev e159524c43 [Gradle] Fix warnings in forAllAndroidVariants extension
^KT-56904 In Progress
2024-01-31 12:20:05 +00:00
Alexander.Likhachev 8fe65d2fee [Gradle] Fix warnings in ClassLoadersCache
This check is required due to the way of generic type declaration in the Guava code
^KT-56904 In Progress
2024-01-31 12:20:05 +00:00
Marco Pennekamp 64ad40e863 [LL] LLFirAbstractSessionFactory: Fix eager loading of anchor module sessions
- `LLFirAbstractSessionFactory` should not load other sessions eagerly
  because session creation occurs inside a `computeIfAbsent`, which does
  not allow recursive updates to the session cache.
- The issue has not surfaced so far because the default implementation
  of `computeIfAbsent` is not sensitive to recursive updates.

^KT-65418 fixed
2024-01-31 12:19:42 +00:00