Commit Graph

107089 Commits

Author SHA1 Message Date
Sergey Bogolepov 8be547b834 KT-63264: Add a compiler flag that disables C interface generation
We can reuse existing static/dynamic library output kinds for
the Swift Export. The only change we have to make is to make generation
of C interface opt-out by moving it under the binary option.
As a side effect, it allows evolving C Export in the future by
introducing new option variants.
2023-12-12 07:03:25 +00:00
Yan Zhulanow c499095382 [Pill] Fix importing after ideaHomePathForTests() signature change
Before, the 'File' was returned. Now, it's 'Provider<Directory>'.
2023-12-11 19:31:57 +00:00
Dmitrii Krasnov 0b31d70ce9 [Gradle IT] Added Integration Test for checking native ic args
#KT-63742
2023-12-11 18:09:29 +00:00
Alexander Udalov d2a0e1dada Update to jline 3.24.1
It fixes the exception when REPL is run on an ARM Mac, as well as not
quitting after interrupting on the first line.

After this change, REPL runs fine on JDK 8, 17, 21. Note that on JDK 11,
it prints a warning during startup (but then also runs fine):

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator to constructor java.lang.ProcessBuilder$RedirectPipeImpl()
WARNING: Please consider reporting this to the maintainers of org.jline.terminal.impl.exec.ExecTerminalProvider$ReflectionRedirectPipeCreator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

 #KT-18355 Fixed
 #KT-64013 Fixed
2023-12-11 11:34:05 +00:00
Yahor Berdnikau 400137e80d [Gradle] Fix usaged of deprecated buildDir in Kapt3KotlinGradleSubplugin.kt
^KT-62527 In Progress
2023-12-11 11:32:02 +00:00
Yahor Berdnikau 366d097c92 [Gradle] Suppress internal deprecation in Kapt3KotlinGradleSubplugin.kt
^KT-56904 In Progress
2023-12-11 11:32:02 +00:00
Yahor Berdnikau 78edc45ded [Gradle] Remove unused method in Kapt3KotlinGradleSubplugin.kt
^KT-56904 In Progress
2023-12-11 11:32:01 +00:00
Yahor Berdnikau 8028e2a42d [Gradle] Suppress package directory mismatch in Kapt3KotlinGradleSubplugin.kt
^KT-56904 In Progress
2023-12-11 11:32:01 +00:00
Yahor Berdnikau 56c7309fad [Gradle] Suppress Android deprecations in Kapt3KotlinGradleSubplugin.kt
^KT-56904 In Progress
2023-12-11 11:32:01 +00:00
Ilya Goncharov 7b409d0505 [Gradle, JS] Migrate onto usage of layout.buildDir provider in NPM infrastructure.
Api which previously used buildDirectory now migrated to Provider as well, previous properties are deprecated.

^KT-61294 fixed


Co-authored-by: Alexander Likhachev <Alexander.Likhachev@jetbrains.com>
2023-12-11 10:56:28 +00:00
Wojciech Litewka ef53bd9548 [IR generator] Add missing isChild = false
Those fields were effectively marked as child elements after refactor.
However, because of the current (to possibly be changed) configuration,
the generator did not write accept methods for them.
2023-12-11 10:48:43 +00:00
Yahor Berdnikau f016e8efda [Gradle] Fix deprecations in configureReporing.kt
^KT-62527 In Progress
2023-12-09 16:00:28 +00:00
Ivan Kylchik c902e5f565 [JVM_IR] Allow to use irPluginContext when compiling for android
This problem is extensively described in
`cadbc87dfd1ce3e63481ab90874ca8858878c55f` commit message.
TLDR: compiler is also called from Android LiveEdit plugin where
we want to be able to use compiler plugins. For that reason, we have two
different flags in the compiler. One is only for "evaluate expression"
(`doNotLoadDependencyModuleHeaders`) and the other for both LiveEdit
plugin and "evaluate expression" (`shouldStubAndNotLinkUnboundSymbols)`.
We want to forbid using compiler extensions for "evaluate expression"
and allow for LiveEdit plugin.

#KT-63695
2023-12-08 18:34:36 +00:00
Aleksei.Glushko 569d37028f [K/N] Mark barriers implementation
Merge-request: KT-MR-13409
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-12-08 17:52:14 +00:00
Alexey Belkov f53f92cdd6 K2: Add KtDiagnosticRenderers.CLASS_ID to render ClassId FQNs with dots
KT-MR-13391
2023-12-08 17:26:59 +00:00
Alexey Belkov 1766d0e86a K2: Use ClassId instead of FqName in FIR diagnostics
IJ-CR-118828
KT-MR-13391
2023-12-08 17:26:59 +00:00
Dmitrii Gridin 061734d84b [FIR] do not transform type annotations from function parameter during implicit type phase
We shouldn't treat them as local and transform during the implicit type
phase as they are visible from outside the function

^KT-64164 Fixed
2023-12-08 17:17:36 +00:00
Dmitrii Gridin 3d43dff8b5 [LL/FIR] add tests on function parameter as implicit return type
^KT-64164
2023-12-08 17:17:36 +00:00
Ivan Kochurkin 145958e284 [K2] Disable constants evaluation with native metadata compilation
^KT-63835 Fixed
2023-12-08 16:38:04 +00:00
Ivan Kochurkin ec4edbfcf2 [K2] Enable copyEnsuringK2 for all K2Tests by default 2023-12-08 16:38:04 +00:00
Vladimir Sukharev dd0cc7089a Add unittests for FqNameUnsafe.startsWith(FqNameUnsafe) 2023-12-08 16:27:18 +00:00
Vladimir Sukharev 1387e077e9 Improve unittests for FqNameUnsafe.startsWith(Name) 2023-12-08 16:27:18 +00:00
Vladimir Sukharev 93af9f33e4 Fix FqNameUnsafe.startsWith() when first segment of fqName is shorter than given segment
FqNameUnsafe("c.C").startsWith("cnames")
must return false
It's a refix of fdf826208f
2023-12-08 16:27:18 +00:00
Stanislav Erokhin 0dd24a4de9 [Code Owners] Make "Kotlin Apple Ecosystem" owner of commonizer
After discussions, "Kotlin Apple Ecosystem" team agreed to take
responsibility for the Commonizer tool.
P.s. integration between Commonizer and Gradle is responsibility of
the "Kotlin Build Tools" team.
2023-12-08 15:54:15 +00:00
Dmitriy Novozhilov 3a5e45eb55 [FIR] Fix work with scopes in FirNativeObjCRefinementOverridesChecker
This fixes the following test, which started to fail after previous commits:
- `FirPsiOldFrontendNativeDiagnosticsTestGenerated#testObjCRefinement`
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 4a2f9a5123 [FIR] Mute some tests back due to KT-64081
They were accidentally fixed with `[FIR] Process all overridden members from intersection scopes`
  commit, which itself introduced incorrect behavior, which was properly
  fixed with ... commit. So KT-64081 started to appear again
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov bc95c5d142 [FIR] Make MemberWithScope a data class
Previously, there was a contract that each callable symbol in the chain
  of `processDirectOverriddenWithBaseScope` will be unique. And if some
  symbol is accessible from multiple scopes, then only last of them will
  be returned as a component of `MemberWithScope`. So there actually was
  no such thing as "pair of two different MemberWithScope with the same
  symbol and different scopes"

After the change of `processDirectOverriddenWithBaseScope` contract (see
  previous commits) each scope returns `MemberWithScope` for some symbol
  with the previous scope in the hierarchy even if it contains the same
  symbol as the current scope

So now scope is actually a part of `MemberWithScope`, which should be
  considered as part of equality. Otherwise, we can skip some part of
  the overridden hierarchy, because we will start to consider symbol as
  visited after its first occurrence (in opposite to the previous behavior,
  when only the last scope was returned)
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 385bff3be1 [FIR] Update all required places according to changed overridden processing contract
This commit fixes all places that relied on the contract described in
  the previous commit and also updates corresponding tests

^KT-63738
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 4272f2e156 [FIR] Process all overridden members from intersection scopes
Previously, there was a contract that each callable symbol in the chain
  of `processDirectOverriddenWithBaseScope` will be unique. And if some
  symbol is accessible from multiple scopes, then only last of them will
  be returned as a component of `MemberWithScope`

But after the change from previous commit, we don't have this contract anymore.
  Which means that we may meet the same symbol during processing hierarchy
  of overridden functions (but with different base scopes)

So if some code utilizes `process...Overridden...WithBaseScope` functions
  it should consider that the same symbol may be obtained several times

^KT-63738 Fixed
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov c34511af37 [Test] Reproduce KT-63738 2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov a15057b2ca [FIR2IR] Unwrap only call-site overrides during delegated members generation
^KT-60251 Fixed
2023-12-08 15:19:55 +00:00
Artem Olkov 6dc56158f9 Add gradle task that executes all tests from all SIR related modules
Merge-request: KT-MR-13410
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-08 15:14:29 +00:00
Brian Norman 5f9fb06034 [PowerAssert] Update CODEOWNERS and license README for power-assert 2023-12-08 08:46:41 -06:00
Brian Norman dc198be0ad Merge branch 'bnorm/kotlin-power-assert' 2023-12-08 08:46:35 -06:00
Brian Norman 0881910a1b [FIR] Rewind DFA after call arguments for correct receiver smartcasting
^KT-63709 Fixed
2023-12-08 14:32:22 +00:00
Artem Olkov 38d5e56530 KT-63273: Swift IR passes to support functions with numeric parameters
Merge-request: KT-MR-13290
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-08 14:07:42 +00:00
Dmitriy Novozhilov 7d685522ce [IR] Fix calculation of receiver type for properies in expect/actual context
^KT-62926 Fixed
2023-12-08 13:28:27 +00:00
Evgeniy.Zhelenskiy 9cef8a2133 [FIR, Tests] Add box tests to verify that disappeared DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE leads to executable code
#KT-59903


Merge-request: KT-MR-13423
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2023-12-08 13:18:59 +00:00
Leonid Startsev aff5b91da3 Provide changelog and migration guide for kotlinx-metadata-jvm 0.8.0 2023-12-08 13:12:50 +00:00
Dmitrii Krasnov 331ec5318d [Gradle] Added definitionFile RegularFileProperty in cinterop task
^KT-62795 Fixed

Merge-request: KT-MR-13307
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-12-08 12:56:52 +00:00
Troels Bjerre Lund f1b6c2df45 Native: add missing stubs for objc for non-objc targets
Kotlin code for Objective-C interop is always included to stdlib.
It depends on some C++ code. The latter is compiled conditionally -
only for targets supporting Objective-C interop. That might cause
undefined symbols problems when DCE is not enabled.

To deal with it, we usually have trivial stubs in C++ code, used
for targets not supporting Objective-C interop.

This commit adds a couple of such missing stubs.
2023-12-08 11:43:45 +00:00
Dmitriy Novozhilov 58678c09e8 [FIR2IR] Include generated IR fields into Fir2IrCommonMemberStorage
In case of HMPP structure with common JVM module (e.g. shared between
  JVM and Android) one can reference the same field from java code,
  so it should be shared between fir2ir sessions

^KT-63574 Fixed
2023-12-08 11:16:03 +00:00
Sergej Jaskiewicz 701a48b211 [SIR] Fix transformer auto-generation
The default implementation of a transformer method should delegate to
`parentInVisitor`
2023-12-08 10:09:09 +00:00
Sergej Jaskiewicz 0d2032f3ef [SIR] Auto-generate the Swift IR tree
Co-authored-by: Gleb Lukianets <gleb.lukianets@jetbrains.com>
2023-12-08 10:09:09 +00:00
Sergej Jaskiewicz 39c84bca06 [tree generators] Add a method for configuring all leaf builders
It will be used in the new Swift IR tree that will be added in the next
commit.
2023-12-08 10:09:09 +00:00
Martin Kretzschmar 12905858fc [debug][bindings][python] Let lldb narrow list of symbols
Marshalling the full list of symbols to Python and filtering that was
slow for binaries with large numbers of symbols.

^KT-63749
2023-12-08 09:36:41 +00:00
Roman Golyshev 78f492394c KT-64186 [LL] Correctly handle anonymous objects' headers in ContextCollector
This bug spilled into reference shortener, and then to
"redundant qualifier inspection" and code completion from there;
it caused KTIJ-26024 to reproduce again (but only for anonymous objects)

^KT-64186 Fixed
2023-12-08 09:14:43 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Vladimir Dolzhenko a3c1f4ea12 Fix rendering of platform type for value parameters
#KT-63979 Fixed
2023-12-08 06:45:22 +00:00
Alexander Udalov fe1e2b8b34 jvm-abi-gen: Support removeDebugInfo option
This option removes debug info, such as:
- SourceFile attribute on classes
- LocalVariableTable, LineNumberTable, SourceDebugExtension attributes
  on inline functions
- @SourceDebugExtension annotation on inline functions

 #KT-33020 Fixed
2023-12-07 20:50:01 +00:00