Commit Graph

107476 Commits

Author SHA1 Message Date
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
Nikita Bobko 9da29d46aa FirElementSerializer cleanup
Review: https://jetbrains.team/p/kt/reviews/13495/timeline
2023-12-21 11:10:14 +00:00
Yahor Berdnikau ea8f7af1f2 [Gradle] Add api marker to Kotlin compilation tasks DSL
Kotlin's compilation tasks DSL should also be separated from other DSL
parts.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Yahor Berdnikau 2af60a5e27 [Gradle] Add deprecated access to sourceSets container inside KotlinTarget
This should keep compatability with user scripts that for any reason tried to configure 'sourceSets' container inside KotlinTarget, but keep such users warned.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Yahor Berdnikau 36e85fec95 [Gradle] Introduce public KotlinGradlePluginDsl marker annotation
The purpose of this annotation is to distinguish different levels of DSL
 in KGP:
- top level extension
- target level DSL
- compilation level DSL

With this marker user should not be able to call implicit methods from
upper levels of DSL, and it should reduce confusion with DSL usage.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Yahor Berdnikau 74b4adf8e2 [Gradle] Rename internal KotlinGradlePluginDsl into KotlinGradlePluginPublicDsl
This is an internal annotation that eventually should go away, and the
name is clashing with more public annotation is going to be introduced
in the API project.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Mikhail Glukhikh a02cf76d6c K2: build SAM-based function type for a given captured type properly
Before this commit, we assumed (erroneously) that a captured type
cannot have an associated SAM-based function type.
In this commit we changed this assumption, replacing a captured type
with its lower type for this purpose

#KT-63379 Fixed
2023-12-21 10:19:23 +00:00
Mikhail Glukhikh 8588588760 K2: add test reproducing KT-63379 2023-12-21 10:19:23 +00:00
Dmitrii Gridin de44b7dc3b [LL FIR] LLFirSuperTypeTargetResolver: pass correct session during resolution
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls.
Also, this means that we should process 'expect' classes
before 'actual' like it was for 'super' and 'sub' classes

^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 960a59d49a [LL FIR] LLFirSupertypeComputationSession: rename session to useSiteSession
^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 35a7e0db12 [LL FIR] LLFirSupertypeLazyResolver: covert receiver to parameter
To separate it from the next refactoring

^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 14082f6924 [LL FIR] LLFirLazyResolver: drop redundant FirSession argument
LLFirSession should be received from LLFirResolveTarget to avoid
potential wrong sessions
ScopeSession cannot be dropped yet as we should be able to use another
session during on-air resolution to avoid garbage in the original one

^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 1538c125c3 [LL FIR] LLFirReturnTypeCalculatorWithJump: use declaration-site ScopeSession
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls

^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin e3841a1728 [Analysis API] add test for duplicated callable during implicit type
^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 51f6525238 [LL FIR] LLFirCompilerAnnotationsLazyResolver: pass correct ScopeSession
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls.

^KT-63547 Fixed
2023-12-21 09:34:39 +00:00
Dmitrii Gridin d83392a27a [LL FIR] LLFirStatusLazyResolver: pass correct session during resolution
We should use the declaration-site session to have stable
resolution order. The same scheme is applicable during
regular lazy resolution calls.
Also, this means that we should process 'expect' classes
before 'actual' like it was for 'super' and 'sub' classes

^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 6ca6221be9 [LL FIR] LLFirStatusLazyResolver: more conservative optimization for actual classes
We cannot skip resolution in the case of type actualization as we cannot
guaranty that there are no any classes in super types which can be
actualized in the current context

^KT-62832 Fixed
^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 0dace65f05 [LL FIR] add lazy resole test for actual override
^KT-63547
2023-12-21 09:34:39 +00:00
Dmitrii Gridin 4bd73e4ccd [Analysis API] add diagnostic test for compiler annotation with argument from another module
^KT-63547
2023-12-21 09:34:39 +00:00
Yahor Berdnikau acf3f2a3a1 [Gradle] Fix warnings in NativePerformanceReport
^KT-56904 In Progress
2023-12-21 08:33:58 +00:00
Yahor Berdnikau 705c9b50a9 [Gradle] Fix deprecated buildDir access in NativePerformanceReport
^KT-62527 In Progress
2023-12-21 08:33:58 +00:00
Mikhail Glukhikh fabeb7fbef Move JsAllowInvalidCharsIdentifiersEscaping to the proper section 2023-12-21 07:43:38 +00:00
Mikhail Glukhikh 3a106fc88e K1/K2: add some more tests around KT-63558 2023-12-21 07:43:38 +00:00