Commit Graph

107072 Commits

Author SHA1 Message Date
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
Alexander.Likhachev 73af0fffa9 [Build] Update Gradle Enterprise plugin to 3.14.1
^KTI-1473 Fixed
2023-12-07 18:31:07 +00:00
Alexander.Likhachev 28dad289b3 [Build] Remove attributes setup for the dependency scope configurations
This behaviour makes no sense and is deprecated: https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#deprecated_configuration_usage
^KTI-1473 In Progress
2023-12-07 18:31:07 +00:00
Alexander.Likhachev 5e51826050 [Build, K/N] Remove registration and usages of convention.plugins.platformInfo
The entire concept of conventions is deprecated in Gradle. Here it was making the build logic implicit and hard for understanding
^KTI-1473 In Progress
2023-12-07 18:31:07 +00:00
Alexander.Likhachev f5bcdb85a5 [Build] Migrate kotlin-stdlib-gen to Gradle Kotlin DSL 2023-12-07 18:31:07 +00:00
Alexander.Likhachev 9a0cf9c9f9 [Build] Rename kotlin-stdlib-gen/build.gradle -> build.gradle.kts 2023-12-07 18:31:06 +00:00
Alexander.Likhachev 0926ebac23 [Build] Remove BasePluginConvention usages
The entire concept of conventions is deprecated in Gradle. The proposed alternative for `BasePluginConvention` is `BasePluginExtension`
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev 0fbd2e960d [Build] Remove redundant .forUseAtConfigurationTime() calls
Starting from Gradle 7.4, these calls are no longer required.
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev 1dc76f0b94 [Build] Fix configuration cache issue with :repo:artifacts-tests:test
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev f915efab18 [Build] Update artifacts tests test data after the Gradle 8.4 upgrade
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev eab2c6b9b9 [Build] Bump gradle-node-plugin version to 7.0.1
This change is required to fix a configuration cache problem revealed after migration to Gradle 8.4
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev 35960f65fb [Build] Upgrade Gradle to 8.4
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev ad677cb573 [Build] Use dependencies.create instead of dependencies.module
It seems there was no actual need for a call to `dependencies.module`.Also, it's going to be deprecated in Gradle 8.3
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev b784544f8d [Gradle] Migrate functional tests from Project.buildDir usage
It's going to be deprecated in Gradle 8.3
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Kirill Rakhman 81517a3d29 [FIR] Set targets of annotation classes in FirJavaElementFinder
#KT-60504 Fixed
2023-12-07 18:29:45 +00:00
Kirill Rakhman daa02813c2 [FIR] Generate FIR diagnostics with explicit types
#KT-64147 Fixed
2023-12-07 18:29:28 +00:00
Dmitrii Krasnov fc1ada4896 [Gradle] Changed compileKotlinTask to compileTaskProvider 2023-12-07 18:14:13 +00:00