Commit Graph

107099 Commits

Author SHA1 Message Date
Ilya Chernikov b0f44e8f69 K2 Scripting: mark parameters and DD containers with dedicated origins
needed for properly processing script CFG
2023-12-12 09:58:19 +00:00
Ilya Chernikov 8c30f3b2bc K2 Scripting: add FirScript to declaration checkers 2023-12-12 09:58:18 +00:00
Ilya Chernikov b7057eb22f K2 Scripting: make FirScript a CFG owner 2023-12-12 09:58:18 +00:00
Alexander Korepanov 41ebe498f2 [JS IR] Explicitly cast to a string all types except specific ones
^KT-62763 Fixed
2023-12-12 09:53:19 +00:00
Alexander Korepanov 70d99e1964 [JS IR] Add tests for string template with valueOf
^KT-62763
2023-12-12 09:53:19 +00:00
Artem Olkov 6c4a6e2a02 turn on explicitApi for SIR modules
Merge-request: KT-MR-13448
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-12 09:02:55 +00:00
Leonid Startsev a03fd2e29a Make visibilities of writeSelf and deserialization constructor in FIR
same as they were in K1 (see KSerializerDescriptorResolver): internal for
final classes and public for non-final.

Unfortunately, there are no Klib API dumps tests in the compiler, so I tested manually.

#KT-64124 Fixed
2023-12-12 09:02:14 +00:00
Leonid Startsev 9933423a0b Add KmVersionRequirementKind.UNKNOWN
for cases when the version requirement cannot be read correctly (missing from the table).

It usually happens when we read the inner class' old metadata, which stored everything
in the outer class' table.

Fixes #KT-60870


Merge-request: KT-MR-13337
Merged-by: Leonid Startsev <leonid.startsev@jetbrains.com>
2023-12-12 08:47:41 +00:00
Kirill Rakhman 8a863e00ba [FIR] Add proper constraint if Unit upper bound leads to Unit lambda return type
#KT-63524 Fixed
2023-12-12 08:36:49 +00:00
Sergey Bogolepov ce4eecebf4 KT-63264: Introduce a new ExportedBridge annotation
Swift Export Frontend generates a Kotlin file/library that contains a
set of simple bridging functions that connect Swift wrappers to their
Kotlin counterparts.
There are certain requirements for these wrappers:
1. They should not be DCEd when compiling a binary library.
In other words, these functions are roots.
2. They should provide a stable simple binary name.
3. Their signatures should be much simpler and restricted comparing to
other Kotlin functions.

Altogether, these requirements should be covered by introducing the new
ExportedBridge annotation.

Note: Frontend checks of ExportedBridge functions are not implemented
yet.
2023-12-12 07:03:25 +00:00
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