Commit Graph

100297 Commits

Author SHA1 Message Date
Mikhail Glukhikh bde0282fb1 K2: extract constant from Java enum entry properly
#KT-58002 Fixed
2023-04-17 21:05:04 +00:00
Mikhail Glukhikh 0a126a173e K2: reproduce KT-58002 2023-04-17 21:05:03 +00:00
Mikhail Glukhikh 5cff8c15ab K2: fix intrinsic analysis in FirToConstantValueChecker
#KT-57986 Fixed
2023-04-17 20:53:31 +00:00
Mikhail Glukhikh c826c7301c K2 JS/Native: reproduce KT-57986 2023-04-17 20:53:30 +00:00
Ivan Kochurkin beaeb405d2 [K2, MPP] Build expect-actual map for type parameters from functions
^KT-57181 Fixed
2023-04-17 19:55:35 +00:00
Ivan Kochurkin 3a60b30dae Minor: IrActualizationResult -> IrActualizedResult 2023-04-17 19:55:35 +00:00
Ivan Kochurkin b7bb9c317f [K2, MPP] Introduce FunctionDefaultParametersActualizerVisitor and use it in FunctionDefaultParametersActualizer
^KT-57263 Fixed
2023-04-17 19:55:34 +00:00
Ivan Kochurkin 1073797ed3 [IR] Extract ActualizerSymbolRemapper and ActualizerVisitor from ExpectActualLinker
It will provide the possibility to use them not only locally

Clarify code of IrActualizer pipeline
2023-04-17 19:55:34 +00:00
Mikhail Glukhikh 2ccad553e6 K1/K2: allow to apply suspend modifier to anonymous function
#KT-57991 Fixed
2023-04-17 18:05:44 +00:00
Mikhail Glukhikh 0dbf698653 K1: count anonymous function as function expression in checkers
Related to KT-57991
2023-04-17 18:05:44 +00:00
Mikhail Glukhikh c8b74e5655 K2: reproduce KT-57991 2023-04-17 18:05:43 +00:00
Nikita Bobko 5a96754aec Shift ReferencesToSyntheticJavaProperties feature release from 1.9 to 2.1
Other related tests:
- testGenericJavaProperty
- testFunInterfaceConstructorReference

Meta issue: KT-8575
Review: https://jetbrains.team/p/kt/reviews/9595

UnsupportedSyntheticCallableReferenceChecker only existed for K1,
because we wanted to release the feature for 1.9 and the feature should
have been working for K2 unconditionally. But since, we're postponing
the release until 2.1, we also need to port the checker from K1 to K2
2023-04-17 17:42:01 +00:00
Zalim Bashorov 521a272acb [Wasm] Pass js stack value directly when replacing a wasm exception with JS one
In this case, we don't need to convert a value to and from wasm String.
2023-04-17 16:15:22 +00:00
Zalim Bashorov 6bfd1e7e9f [Wasm] Stop using unsigned numbers in ScopedMemoryAllocator
It turned out that using unsigned numbers is heavy both in terms of size and performance.
We can consider switching back (KT-58041) as soon as we implement unsigned numbers and operations using wasm built-in capabilities (KT-58039).
2023-04-17 16:15:22 +00:00
Zalim Bashorov c114afb55d [Wasm] export __callFunction_* only when a respective closure/lambda converter is used 2023-04-17 16:15:21 +00:00
Mads Ager 699ad87be2 [KAPT+IR] Use ErrorType for unresolved delegate class.
^KT-57946
2023-04-17 16:49:11 +02:00
Yahor Berdnikau 1801277a0c Add newly published compiler plugins as a requirement for KGP tests
^KT-52811 Fixed
2023-04-17 14:40:51 +00:00
Yahor Berdnikau 1eb27f2aac Update publishing and usage of kotlin-annotation-processing plugin
- removed 'kotlin-annotation-processing-gradle' publication as it
duplicated 'kotlin-annotation-processing-embeddable'
- removed 'kotlin-annotation-processing-maven' as it is embedded into
  'kotlin-maven-plugin'. Instead 'kotlin-maven-plugin' now depends on
  'kotlin-annotation-processing' directly.

^KT-52811 In Progress
2023-04-17 14:40:51 +00:00
Yahor Berdnikau a58d6fd13a Publish 'kotlinx-serialization-compiler-plugin' separately
- Also publish 'kotlinx-serialization-compiler-plugin-embeddable' to be
used with 'kotlin-compiler-embeddable'.
- Now Serialization Maven and Gradle plugins do not embed plugin into
itself, but declare on published one normal dependency.
- 'kotlin-serialization-unshaded' publication is deprecated.

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 78c94b65b9 Change sam-with-receiver plugin to use published compiler plugin
- also publish 'kotlin-sam-with-receiver-compiler-plugin-embeddable' to
  be used with 'kotlin-compiler-embeddable'
- 'kotlin-maven-sam-with-receiver' now just adds
  'kotlin-sam-with-receiver-compiler-plugin' as normal dependency
  instead of embedding it into itself

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau a58266050f Publish noarg compiler plugin separately
- also publish 'kotlin-noarg-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-embeddable'
- 'kotlin-noarg-maven' plugin now just adds
  'kotlin-noarg-compiler-plugin' as normal dependency instead embedding
  it into itself

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 1a4d203d1c Publish lombok compiler plugin separately
- also add 'kotlin-lombok-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-emebeddable'
- 'kotlin-maven-lombok' does not try to embed plugin into itself and
  just depends on compiler plugin as normal dependency

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 5e41cbda75 Change kotlin-assignment plugin to use published compiler plugin
^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 1ccd7afde7 Publish allopen compiler plugin separately
- added also 'kotlin-allopen-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-embeddable'
- 'kotlin-maven-allopen' now just depends on
  'kotlin-allopen-compiler-plugin' instead of "embeding" it into itself

^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 64f8b87b66 Publish atomicfu compiler plugin separately
- rename plugin into 'kotlin-atomicfu-compiler-plugin'
- add 'kotlin-atomicfu-compiler-plugin-embeddable' to be used with
  'kotlin-comiler-embeddable'

^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 8ad67faa60 Resolve also transitive dependencies for compilerPluginClasspath in maven
This allows to depend on actual compiler plugin instead of embedding it into maven compiler plugin.

^KT-52811 In Progress
2023-04-17 14:40:48 +00:00
Yahor Berdnikau e1bd7d7b5d Add methods to also embed sources and javadoc from embedded dependencies
Introduced approach is not ideal as it introduces direct inter-project
call breaking project isolation. But proper solution requires quite a
lot of changes and should be done separately.

^KT-52811 In Progress
2023-04-17 14:40:48 +00:00
Nikolay Krasko cdec1e6c62 Update used based image for Kotlin builds 2023-04-17 13:33:51 +00:00
Nikolay Krasko a5876811d8 Instruction for 1.8.20 build 2023-04-17 13:33:50 +00:00
Dmitrii Krasnov 9c32a66e9c migrated NativeExternalDependenciesIT to gradle TestKit 2023-04-17 13:22:25 +00:00
Svyatoslav Scherbina 8466bec048 Native: fix ring benchmark compilation error
`@file:OptIn` can't be applied to a class. Change it to `@OptIn`.
2023-04-17 13:03:13 +00:00
Abduqodiri Qurbonzoda 12f7a6de3e [K/N] Experimental ByteArray.get/setPrimitiveAt(index) functions
As a part of Native stdlib stabilization efforts.

Merge-request: KT-MR-9346
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-17 12:42:31 +00:00
Evgeniy.Zhelenskiy aceab2ac1f [IR] Fix KT-57973
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-57973
2023-04-17 12:33:10 +00:00
Abduqodiri Qurbonzoda e7225d29ff [K/N] Mark unit testing API with ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-17 12:30:42 +00:00
Evgeniy.Zhelenskiy 8c748bfea4 [IR] Add more tests for inline/value classes secondary constructors
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2023-04-17 12:10:14 +00:00
Abduqodiri Qurbonzoda f75b72990e [K/N] Deprecate SuspendFunction interface with WARNING
As a part of efforts to stabilize Native stdlib.
2023-04-17 12:01:55 +00:00
Jinseong Jeon fbe558a0de AA FIR: handle smartcasted arg when building call's argument mapping
^KTIJ-25112 Fixed
2023-04-17 13:57:08 +02:00
Yahor Berdnikau 86540bdbb4 [Gradle] Fix flaky test
Commonizer may run first and produce compiler arguments output as well
in test output.
2023-04-17 11:45:57 +00:00
Marco Pennekamp 73d99019bd [AA] KT-57515 Add createCompositeModificationTracker 2023-04-17 11:20:52 +00:00
Mikhail Zarechenskiy fc37885d6d K1: report a warning for invisible setter accessed from a derived class
The issue is that during binding fake overrides, the compiler doesn't
 differ setters from its properties, so the compiler uses the same
 visibility for setter and entire property.

 Changing logic at the binding stage can cause some unpredictable consequences so
 the fix is to do this differentiation right at the reporting stage

 ^KT-56662 Fixed

Merge-request: KT-MR-9565
Merged-by: Michail Zarečenskij <Mikhail.Zarechenskiy@jetbrains.com>
2023-04-17 11:08:16 +00:00
Marco Pennekamp d8f253d07b [LL FIR] KT-57207 Choose combined Java symbol providers cache size 2023-04-17 11:07:48 +00:00
Marco Pennekamp e13d4f2328 [LL FIR] KT-57207 Combine Java symbol providers
- `LLFirCombinedJavaSymbolProvider` combines multiple
  `JavaSymbolProvider`s. Its advantages are: combined index access,
  caching, classpath order disambiguation.
- Scopes can still be optimized with a combined scope instead of a naive
  union scope.

^KT-57207 fixed
2023-04-17 11:07:48 +00:00
Marco Pennekamp 3da3e14543 [LL FIR] KT-57220 Get rid of duplicate providers field 2023-04-17 11:07:47 +00:00
Marco Pennekamp b50ecfddb7 [LL FIR] KT-57220 Make combined symbol provider constructors private
- The combined symbol provider should always be constructed using the
  dedicated `merge` function.
2023-04-17 11:07:47 +00:00
Marco Pennekamp 567abd2a1c KT-57207 Implement JavaClassFinder.findClasses
- This change is a prerequisite for allowing combined Java symbol
  providers (in LL FIR) to correctly disambiguate classpath order after
  getting classes with a combined scope, as the index access of the
  combined Java symbol provider is not guaranteed to return the class
  that should be first based on the original dependency order. To be
  able to disambiguate, a combined Java symbol provider needs access to
  all class candidates the index can find.
2023-04-17 11:07:47 +00:00
Marco Pennekamp f2e3c593a1 [FIR] KT-57207 JavaSymbolProvider: Accept existing JavaClasses
- `javaFacade.findClass` is a potentially costly operation. This commit
  extends `JavaSymbolProvider` and its class cache to accept an already
  existing `JavaClass` if provided, circumventing the `findClass`
  operation.
2023-04-17 11:07:46 +00:00
Marco Pennekamp b33c5f77ac [FIR] Move JavaClass.hasMetadataAnnotation to JavaUtils
- This function will be reused in a later commit.
2023-04-17 11:07:46 +00:00
Marco Pennekamp 288606868e [FIR] KT-57207 Avoid FirJavaFacade.knownClassNamesInPackage in the IDE
- `FirJavaFacade.knownClassNamesInPackage` cannot be computed in the IDE
  using the current strategy because there are multiple finders and
  there is no `CliFinder`. However, the cache was still used, which
  caused it to be filled with `null` values and additionally caused
  worse performance in `JavaSymbolProvider` due to hash map accesses via
  `hasTopLevelClassOf`.
- Rewriting the strategy is non-trivial as additional indices are needed
  on the IDE side. See KTIJ-24642.
2023-04-17 11:07:46 +00:00
Marco Pennekamp 624164e183 [LL FIR] Remove unused "multi module lazy resolve" test data
- The test `AbstractFirMultiModuleLazyResolveTest` which used this test
  data was moved to `intellij` with the following commit: https://github.com/JetBrains/kotlin/commit/39fa2b0baf89b246348b1e9c33cfebfc3068c014
- In `intellij`, the test was later deleted with the following commit: https://github.com/JetBrains/intellij-community/commit/042a50dcdff50b0771e73c6948b020a5366ef137#diff-74605de26ac0b4a2a65e53e919001d51199769822a46620ac34ba7e08e85f5e0
2023-04-17 10:57:06 +00:00
Alexander Udalov 287e0909cc Kapt+JVM_IR: do not generate super constructor call
#KT-57699 Fixed
 #KT-57939 Fixed
2023-04-17 10:40:15 +00:00