Commit Graph

107498 Commits

Author SHA1 Message Date
Dmitrii Gridin d88249bda7 [Analysis API decompiler] materialize delegate declarations in stubs
We should materialize delegated declarations to process callables
in scopes correctly. Standalone mode works the same way as it
deserialize directly into FIR.
Another solution is to rework proto and stub serializer/deserializer to
restore FirFields like `$$delegate_0` correctly to work with
`FirDelegatedMemberScope`

^KT-62896 Fixed
^KT-64584 Fixed
2023-12-28 08:48:08 +00:00
Dmitrii Gridin 06950f57db [Analysis API] add tests for delegate field
^KT-64584
2023-12-28 08:48:08 +00:00
Dmitrii Gridin 3f337bf62d [Analysis API] add diagnostic test for delegate from library
^KT-62896
2023-12-28 08:48:08 +00:00
Evgenii Mazhukin ee3119e9d2 [KGP] Introduce Incremental Compilation Feature Toggles
Makes it easier to introduce a Gradle property for configuring
IncrementalCompilerRunner.

^KT-64513 Fixed
^KT-63837 In Progress


Merge-request: KT-MR-13671
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-12-27 13:43:54 +00:00
Evgenii Mazhukin 97f8f7a734 [KGP] Fix warnings related to inheritance of @Deprecated annotation
Merge-request: KT-MR-13675
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-12-27 13:23:23 +00:00
Yahor Berdnikau bffdece8da [Gradle] Fix warnings in AndroidVariantType.kt file
^KT-56904 In Progress
2023-12-27 12:37:28 +00:00
Dmitrii Gridin 441072c6fe [LL FIR] StubBasedFirDeserializedSymbolProvider: fix loading of nested classes
We cannot load nested class without an outer as in this case we will
miss a symbol of the outer class, which is crucial in some cases
(e.g., during status calculation).
So we have to load the topmost class as it will load all nested classes
with the correct context as well

^KT-62891 Fixed
2023-12-26 16:53:36 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
cristiangarcia 5a1fb78fcd Declare generated SourceSets correctly
Allow Gradle to keep the track of the task generating the sources
KTI-1502 Fixed
2023-12-24 00:01:59 +00:00
Ivan Kochurkin 88f7b085e6 [FIR] Try to infer result type of incomplete when expression
^KT-62069 Fixed
2023-12-22 16:57:07 +00:00
Dmitrii Gridin e2f245096c [FIR] ReturnTypeCalculator: replace !! with useful exception
^KT-64196
2023-12-21 23:10:58 +01:00
Dmitrii Gridin 1ec994cd0d [Analysis API] add diagnostic test for FP expose diagnostic from library
^KT-64468
^KT-62891
2023-12-21 19:48:22 +00:00
Dmitrii Gridin 282cd82539 [Analysis API] AnalysisApiFirSourceTestConfigurator: supports mixed multi-module tests
^KT-64468
2023-12-21 19:48:22 +00:00
Dmitrii Gridin c0b333dfc1 [Analysis API] AbstractAnalysisApiBasedTest: exit from ignored tests before any analysis
It is possible that `prepareToTheAnalysis` will throw an exception for
ignored test

^KT-64468
2023-12-21 19:48:22 +00:00
Dmitrii Gridin bd9e69d196 [LL FIR] SealedClassesInheritorsCaclulatorPreAnalysisHandler: do not calculate inheritors for binary files
It fails with ast loading

^KT-64468
2023-12-21 19:48:22 +00:00
Dmitrii Gridin 00db7fdaeb [Analysis API] mark MODULE_KIND directive as module-level
^KT-64468
2023-12-21 19:48:22 +00:00
Dmitrii Gridin d1cb9ab060 [Analysis API] TestModuleKind: introduce moduleKind util
^KT-64468
2023-12-21 19:48:22 +00:00
Marco Pennekamp 43a3f7db5f [AA] Use MODULE_KIND in standalone API multi-module binary tests
- `MODULE_KIND` is a more general and straight-forward approach than an
  "app" magic module name.

^KT-64468
2023-12-21 19:48:22 +00:00
Marco Pennekamp d3d21b3f34 [AA] Support multi-module tests with mixed KtModule kinds
- This commit adds a `MODULE_KIND` directive to Analysis API tests which
  can be used to change a test module's `KtModule` kind from the default
  determined by the test's registered `KtModuleFactory` (which in turn
  depends on the `moduleKind` configured during test generation).
- The most important use case is the ability to have multi-module tests
  where a main module references symbols from a binary library module.
  This use case requires source configurations to compile libraries,
  which requires additional setup. This will be implemented in a
  following commit.

^KT-64468 Fixed
2023-12-21 19:48:22 +00:00
Dmitrii Gridin 69a2bc9abc [Analysis API] add regression test on error diagnostics for functional interfaces
^KT-63432 Obsolete
2023-12-21 19:36:44 +00:00
Dmitrii Gridin 48c36ce475 [FIR] FirJavaFacade: calculate default value for annotations lazily
To avoid contract violation

^KT-62776 Fixed
2023-12-21 18:43:19 +00:00
Dmitrii Krasnov b90ff94451 [Gradle] Suppressed GradleExecutionContext.fromProject
^KT-56904
2023-12-21 18:43:01 +00:00
Tatiana Bogdanova afcef3e20e Add changelog for 1.9.22 2023-12-21 17:48:12 +00:00
Anastasia.Nekrasova 867be40c8e K1/K2: add tests for KT-55811 2023-12-21 16:37:10 +00:00
Aleksei.Cherepanov 5150812838 [IC] Add test for potential sam change in kotlin-java interop
JPS tests were fixed on IJ side during implementation of JPS on graph

Relates to KT-21534
2023-12-21 16:09:14 +00:00
Kirill Rakhman 49ae1b8d01 [FIR2IR] Consolidate type approximation
This commit gets rid of the redundant typeApproximatorConfiguration
in Fir2IrTypeConverter and uses the type approximator for captured
types instead of the manual approximation used before.

This fixes the nullability of approximated captured types, which fixes
a runtime error in WASM.

This also brings K2 IR closer to K1 IR in one test.

#KT-64261 Fixed
2023-12-21 15:56:49 +00:00
Jinseong Jeon 52a1ffb312 AA: better way to filter out non-JVM modules 2023-12-21 15:34:34 +00:00
Jinseong Jeon ea17bbeddc AA: avoid using compiler impl detail as API return type 2023-12-21 15:34:34 +00:00
Jinseong Jeon f5d2ce3022 AA: render containing file and JvmClassName 2023-12-21 15:34:34 +00:00
Jinseong Jeon 797174ee1f AA: introduce new APIs to get containing file (symbol) and JvmClassName
^KTIJ-27686
2023-12-21 15:34:34 +00:00
Yahor Berdnikau 5b6363b0df [Gradle] Fix warnings in KotlinAndroidTarget
^KT-56904 In Progress
2023-12-21 15:26:02 +00:00
Alexander Shabalin 0692346715 [K/N][tests] Fix new line handling in termination tests ^KT-61259 2023-12-21 14:55:21 +00:00
Dmitrii Krasnov 672fea9be4 [Gradle] Changed buildDir to buildDirectory in KotlinNativeLink
^KT-62527
2023-12-21 14:31:14 +00:00
Aleksei.Cherepanov f7d93029ff [JPS] Stop depending on a specific implementation of the compiler in some JPS tests
Change base class of AbstractIncrementalCacheVersionChangedTest to abstract one, not related to any specific implementation of compiler because these tests check JPS logic and should not be affected by compiler implementation

^KT-64445 Fixed
2023-12-21 14:21:35 +00:00
Artem Kobzar 053bc08626 [K/Wasm] Add Binaryen sizes to Wasm size tests 2023-12-21 14:19:09 +00:00
Anastasia.Nekrasova 19fe605a3e K1/K2: add tests for KT-58767 2023-12-21 13:39:41 +00:00
Anastasia.Nekrasova 6268cfedab K1/K2: add tests for KT-58766 2023-12-21 13:36:54 +00:00
Dmitrii Krasnov f7aae5b0d4 [Gradle] Suppressed ownModuleName warning in GradleKotlinCompilerRunner
This warning should be fixed during ownModuleName removing

^KT-56904
2023-12-21 13:32:58 +00:00
Kirill Rakhman ad2689ecbf [FIR] Prefer the non-smartcasted receiver in resolution if it's visible
Previously, we would ignore the candidate with the non-smartcasted
receiver if they have the same symbol.
Now we prefer them when they're visible or when the smart cast changes
the nullability.
2023-12-21 13:29:01 +00:00
Kirill Rakhman 5186ba80e2 [FIR] Check for setter visibility in resolution stage
This is required for the following commit where candidates from the
original scope in presence of smart cast will not be ignored if they're
the same symbol.
2023-12-21 13:29:00 +00:00
Kirill Rakhman 737b286d5c [FIR] Remove useless cast 2023-12-21 13:29:00 +00:00
Mikhail Glukhikh d1edbe0c4b FIR scopes: createSuspendView -> more abstract replaceWithWrapperSymbolIfNeeded
Related to KT-59818
2023-12-21 13:10:17 +00:00
Mikhail Glukhikh 1ebf0f5376 K2: show all Java function with suspend view if possible
This commit fixes two tests related to removed workaround of KT-59818,
and also makes processing suspend functions in J/K hierarchy more consistent.
Before this commit, when we had Java class "suspend" method
(implemented with the help of Continuation) overriding Kotlin suspend fun,
the Kotlin suspend fun was visible in outer use-site scope,
and the Java method was invisible.
Also, we used a special "Java suspend view" just to determine
that Java method overrides Kotlin suspend fun and no more.
After this commit, Java class "suspend" method will be visible
in this hierarchy and Kotlin suspend fun will not.
Also, the "suspend" is visible as a synthetic Kotlin suspend fun
which is more correct.

Related to KT-63233
#KT-59818 Fixed
2023-12-21 13:10:17 +00:00
Mikhail Glukhikh 5409a51ce9 K2: remove a workaround for suspend functions implementation status
This commit breaks two diagnostic tests:
- testSuspendJavaImplementationFromDifferentClass
- testSuspendJavaOverrides

Related to KT-59818
#KT-63233 Fixed
2023-12-21 13:10:17 +00:00
Mikhail Glukhikh 7f7bc1f36c K2: add test to reproduce KT-63233 2023-12-21 13:10:17 +00:00
Mikhail Glukhikh b6d2d23f41 K2: use API instead of FirJavaMethod(Constructor) subtyping in enhancement
FirJavaMethod and FirJavaConstructor are implementation classes.
It's anyway not good to check subtyping using them,
because it makes the code implementation-dependent.
This commit begins to check Java origin instead.
2023-12-21 13:10:16 +00:00
Mikhail Glukhikh 2f29738989 K2: use lookupTag instead of classId in use-site scopes
We used this classId to get an associated symbol,
but this way is anyway not recommended (e.g. problems with local classes).
In this commit we migrated to usage of lookup tags instead.
2023-12-21 13:10:16 +00:00
Mikhail Glukhikh 79e041a310 FE: drop a redundant diagnostic test (exact duplicate of suspendJavaOverrides.kt) 2023-12-21 13:10:16 +00:00
Kirill Rakhman f47705f123 [Tests] Add box tests for #KT-59904 2023-12-21 12:03:48 +00:00
Nikita Bobko 843ded892d [FIR] Don't generate Any.{toString, equals, hashCode} for expect value classes in metadata
^KT-64121 Fixed
Review: https://jetbrains.team/p/kt/reviews/13495/timeline

If we generate these declarations then the compiler sees Any.{toString,
equals, hashCode} non-synthetic declarations of common metadata and
reports false positive ACTUAL_MISSING during intermediate (HMPP)
metadata compilation.

See the review for more details
2023-12-21 11:10:15 +00:00