Commit Graph

108642 Commits

Author SHA1 Message Date
Sergey Bogolepov 10e4d34868 [Swift export][KT-65672] Add SIR node for import declaration 2024-02-09 10:15:50 +00:00
Sergey Bogolepov f5b273a6d9 [Swift export][KT-65672] Update SwiftExportRunner
1. Add a trivial logger interface as a way to communicate with environment
2. Add a settings key for bridge module name.
2024-02-09 10:15:50 +00:00
Mikhail Glukhikh 5e4c0186ac Fix exception in checker stage of FirResolveModularizedTotalKotlinTest
#KT-65468 Fixed
2024-02-09 09:34:19 +00:00
Andrey Yastrebov 7c103e257d KT-62380 Copy dummy dSYM directory for cocoapods integration 2024-02-09 09:22:32 +00:00
Yahor Berdnikau 1bae743524 [Gradle] Remove old platform plugins ids
We want to remove Gradle ids for old deprecated multiplatform platform
plugins and eventually clean up the code.

Exception for now is common platform plugin as it is still used
in compiler tests. Will be removed separately.

^KT-65187 Verification Pending
2024-02-09 09:05:25 +00:00
Sebastian Sellmair 4b6624c920 [ObjCExport] Support naming of nested classes
^KT-65204 Fixed
2024-02-09 08:48:16 +00:00
Ilmir Usmanov f1fd84f539 Put $completion parameter to LVT
The parameter, unlike other ones, should span the whole method, since
throughout the whole method it has some value and thus should be
visible.

This effectively rolls bb5a99ec back

 #KT-64309 Fixed
2024-02-08 22:58:20 +00:00
Dmitrii Gridin 77c850f0d0 [LL FIR] LLFirResolveMultiDesignationCollector: simplify code
We can unify all designation calculators and migrate from
`List<LLFirResolveTarget>` to `LLFirResolveTarget`

^KT-65563
2024-02-08 22:28:13 +00:00
Dmitrii Gridin c52b9032ce [LL FIR] pull up custom logic for synthetic properties and accessors
We should process them independently as they can be not related to each
other

^KT-65563 Fixed
2024-02-08 22:28:13 +00:00
Sergej Jaskiewicz 403e9a3df8 [FIR2IR] Simplify insertImplicitCasts() calls
This method always returns `this`, so no need to reassign.
2024-02-08 22:16:20 +00:00
Sergej Jaskiewicz 88b80e0ed2 [FIR2IR] Add Unit coercion for non-last expressions in try/catch blocks
^KT-61088 Fixed
2024-02-08 22:16:20 +00:00
Sergej Jaskiewicz 3d66511ca7 [FIR2IR] Remove unused method from Fir2IrImplicitCastInserter 2024-02-08 22:16:20 +00:00
Sergej Jaskiewicz b5793222d8 [test] Drop unnecessary WITH_STDLIB in an irText test 2024-02-08 22:16:20 +00:00
Alexander Shabalin 4468167a64 [K/N] Move kotlin-native/utilities/basic-utils to compiler/utils 2024-02-08 20:43:11 +00:00
Evgeniy.Zhelenskiy 3ab6e9de28 [K2, CLI] Fix error message in master after merging fix for KT-64989 2024-02-08 19:50:58 +00:00
Alexander Udalov 3f034e8b67 Enable lightweight lambdas (aka invokedynamic) since 2.0
#KT-45375 Fixed
 #KT-58173 Open
2024-02-08 19:46:18 +00:00
Dmitrii Gridin b1b33475fa [SLC] SymbolLightParameterCommon: drop redundant parameterDeclaration
Now we can replace it with kotlinOrigin

^KT-64772
2024-02-08 19:45:17 +00:00
Dmitrii Gridin 255a2d27f7 [SLC] SymbolLightTypeParameter: drop redundant typeParameterDeclaration
Now we can replace it with kotlinOrigin

^KT-64772
2024-02-08 19:45:17 +00:00
Dmitrii Gridin 042042768f [SLC] prefer sourcePsiSafe to psiSafe
We should use only source declarations as anchors as it is a predictable
contract

^KT-64772
2024-02-08 19:45:17 +00:00
Dmitrii Gridin b8306c8242 [SLC] SymbolLightParameterCommon: use only source kotlinOriginal
We shouldn't return it for, for example, SOURCE_MEMBER_GENERATED

^KT-64772 Fixed
2024-02-08 19:45:17 +00:00
Alexander.Likhachev 238d5504d2 [Gradle] Add tests for KT-62921 2024-02-08 19:11:26 +00:00
Alexander.Likhachev f507b19bd3 [Gradle] Move compiler version choosing logic into testHelpers.kt
Also, migrate from custom Kotlin versions to TestVersions.Kotlin.STABLE_RELEASE to avoid adding custom repositories
2024-02-08 19:11:26 +00:00
Alexander.Likhachev a904ded5f2 [Gradle] Replace useCompilerVersion by a Provider API property
Now this property acts as the single source of truth of BTA implementation version used in KGP. It allows both read and write.
^KT-62921 Fixed
2024-02-08 19:11:26 +00:00
Alexander.Likhachev 10cedd495d [BTA] Add Kotlin version getter into CompilationService
^KT-62921 In Progress
2024-02-08 19:11:26 +00:00
Pavel Mikhailovskii f81b1150b2 [KAPT] KT-65453 Disable generation of type annotations in Java stubs
A workaround for KT-65608


Merge-request: KT-MR-14236
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-08 18:05:49 +00:00
Dmitrii Krasnov 18c08eb9ff [Gradle] Added test for addKotlinNativeBundleConfiguration 2024-02-08 17:20:37 +00:00
Dmitrii Krasnov af872b5692 [Gradle] Made kotlin native configuration init only once.
`maybeCreateResolvable` with `also` each time configures configuration.
But we cannot add new dependencies after the configuration is resolved.
Thus, it is more correct to add init block for a case when it is a newly created configuration.

^KTIJ-28742 Fixed
2024-02-08 17:20:37 +00:00
Nikita Bobko 58e1c4c6ac [FIR] Kmp: Deprecate header/impl keywords
Review: https://jetbrains.team/p/kt/reviews/14224/timeline

Timeline:
**(1)** Kotlin 1.1.60 https://github.com/JetBrains/kotlin/commit/59efedf610a25b004edf3d19897ce4dfca28ddb2 `header` keyword is introduced (committed on Dec 13, 2016)
**(2)** Kotlin `header`/`impl` has been deprecated (warning) at least since 1.1.60 https://github.com/JetBrains/kotlin/commit/5d251062677e09d607f295189b7978d5833e448f (committed on Sep 15, 2017)
**(3)** 1.1.60 release https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-compiler/1.1.60/ Nov 13, 2017

It sounds stupid but it looks like `header` was introduced and
deprecated right in the same release. Though it may be possible that we
had a release between **(1)** and **(2)** that I couldn't find

Anyway the keywords have been deprecated since basically forever

The fix is not perfect

"The perfect fix" would be:
1. Introduce a separate `DEPRECATED_MODIFIER_ERROR` diagnostic
2. Introduce LanguageVersionSettings for the `DEPRECATED_MODIFIER_ERROR`
   diagnostic

But "the perfect fix" requires:
1. Adopting `ReplaceModifierFix` in the IDE to make it work with the new
   diagnostic. `ReplaceModifierFix` is only implemented in K1 IDE. So
   there are two ways:
   1. Create a KTIJ ticket to port the diagnostic to K2 IDE (it needs to
      be ported anyway), and **mention** in the ticket that
      `DEPRECATED_MODIFIER_ERROR` also needs to be supported in K2 IDE.
      It's the ticket that nobody will probably find and fix
   2. Go and port `ReplaceModifierFix` to K2 IDE myself. It's fairly
      simple task, but I've not worked in intellij for quite a while,
      and it will take me too much time to index and compile

Considering that DEPRECATED_MODIFIER diagnostic is used only to report
`header`/`impl`, and there are literally 0 known cases when people use
it. It's just easier to convert the diagnostic to error in K2

Related tests:
- compiler/testData/diagnostics/tests/multiplatform/deprecated/header.kt

^KT-59839 Fixed
2024-02-08 16:34:27 +00:00
Vladimir Tagakov 11d3ead975 jvm-abi-gen: Remove effectively private classes from ABI
#KT-64590 Fixed
2024-02-08 15:19:50 +00:00
Igor Yakovlev 7cf793f308 [Wasm] Add bootstrap declarations 2024-02-08 14:15:17 +00:00
Igor Yakovlev be6b9e8a9a [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-02-08 14:15:17 +00:00
Yahor Berdnikau 55bbaec3f9 [Gradle] Migrate KlibBasedMppIT to new test DSL
^KT-65528 In Progress
2024-02-08 14:04:52 +00:00
Yahor Berdnikau 74c02a77fe [Gradle] Fix compiler arguments plugin does not configure defaults in extension
Shared source sets do not have related compilation tasks, so configuring
 them via an extension is the only possible way. Otherwise, a KGP
 checker will complain on incompatible configuration.

Also, should fix rare cases for kapt when the related KotlinJvmCompile
task is not created, so it does not propagate configured values to kapt
tasks.

^KT-65528 In Progress
2024-02-08 14:04:52 +00:00
Yahor Berdnikau 5686f55b5a [Gradle] Fix warnings in Kotlin2JsCompileConfig
^KT-56904 In Progress
2024-02-08 13:24:30 +00:00
Yahor Berdnikau 50ac596bf2 [Gradle] Fix warnings in DefaultKotlinJavaToolchain
^KT-56904 In Progress
2024-02-08 13:24:30 +00:00
Yahor Berdnikau 7913e12748 [Gradle] Fix warnings in AbstractKotlinCompileTool
^KT-56904 In Progress
2024-02-08 13:24:30 +00:00
Yahor Berdnikau 42a0190986 [Gradle] Fix warnings in KotlinNativeLink
^KT-56904 In Progress
2024-02-08 13:24:30 +00:00
Evgeniy.Zhelenskiy 7eab4b672d [K1, K2, CLI] Mark whole position range of compiler diagnostics in CLI
#KT-64989
2024-02-08 12:59:31 +00:00
Sebastian Sellmair 5b11308d1b [ObjCExport] Translate superClass and superClass generics for class and objects
^KT-65384 Verification Pending
2024-02-08 12:43:48 +00:00
Sebastian Sellmair c22149c642 [ObjCExport] Properly detect Array constructors
^KT-65225 Fixed
2024-02-08 12:41:37 +00:00
Egor Kulikov 926c0a9136 [FIR] Fix naming for light tree delegate and expression conversion 2024-02-08 11:54:00 +00:00
Alexander Shabalin 77b9c40434 [K/N] Fix CrossDistBitcodeCopy task outputs 2024-02-08 11:50:21 +00:00
Alexander Shabalin 3379b3e930 [K/N] Fix stdlib cache task dependency. 2024-02-08 11:50:21 +00:00
Mikhail Glukhikh f3523edb61 Minor cleanup of approximateCapturedType comments/code 2024-02-08 10:49:55 +00:00
Mikhail Glukhikh 44dcae2090 Rename: type -> capturedType 2024-02-08 10:49:55 +00:00
Mikhail Glukhikh 94bcf6d87f K2: handle recursive types properly in approximation
This commit is intended to deal with inconsistency in K1/K2
star projection handling.
K1 star projection includes a 'type' property.
This type from a star projection can be used for relevant
functions / properties return types,
and already includes some approximation for recursive generics.
In contrast, K2 star projection is an object,
and return types of relevant functions / properties are
represented as captured types.
To prevent recursion in them in recursive generic case,
this commit includes additional replacement of their type arguments.
See more details in added comments.

#KT-65057 Fixed
2024-02-08 10:49:55 +00:00
Mikhail Glukhikh c4d6554493 K2: reproduce KT-65057 2024-02-08 10:49:55 +00:00
Pavel Kunyavskiy 0a07f16896 [Commonizer] Better handling of ObjcMethod and related annotations
They are important for overridability rules, so can't be just ignored.
Some arguments are still different on different platforms, so
commonized version is a bit strange.

But the only important part is selector, which should be same on
all platforms.

^KT-57588
2024-02-08 09:46:35 +00:00
Artem Olkov ffed0ecf1f add check for SwiftExport golden-data by running swift compiler #KT-65559 fixed
Merge-request: KT-MR-14210
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-08 09:40:52 +00:00
Abduqodiri Qurbonzoda 5b703c57ec Fix a test failure caused by KT-52181 2024-02-08 07:46:09 +00:00