Commit Graph

106876 Commits

Author SHA1 Message Date
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
Dmitrii Krasnov eb69229b8f [Gradle] Removed using deprecated buildDir in GradleKotlinCompilerRunner
^KT-62527
2023-12-07 17:33:44 +00:00
Andrei Klunnyi 0a57c661fd Comment for LazyScriptDefinitionProvider's property
Relates to KTIJ-27951.
2023-12-07 16:37:35 +00:00
Yahor Berdnikau c26b5ca365 [Gradle] Slight improvement for generated compiler options KDoc
Separated possible and default value from the description.

^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau aeaaf6dd8e [Gradle] Add a check that KGP API has consistent KDoc
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 01e9ad1680 [Gradle] Update KDoc for KotlinTopLevelExtensionConfig
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau e7bd4e6dbd [Gradle] Update KDoc for KotlinHierarchyDsl
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 1671c41652 [Gradle] Update KDoc for Kapt extension
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 71a80b159b [Gradle] Add KDoc for KotlinCompile interface
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 218d3b547b [Gradle] Add documentation for LanguageSettings
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau d12ba2976c [Gradle] Slightly update documentation in JvmTargetValidationMode
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau b22185f140 [Gradle] Add required suppressions for API .dsl package
Some classes or fields in this package should not be present in the
documentation.

^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau f78cddcd3f [Gradle] Fix deprecated buildDir usage in DefaultKotlinCompilationOutputFactory
^KT-62527 In Progress
2023-12-07 15:30:22 +00:00
Svyatoslav Scherbina dd55ca6ed0 Native: fix Swift compilation in tests for tvos_simulator_arm64
e5ae32c removed bitcode embedding from tests. In particular, that commit
disabled bitcode embedding when compiling Swift code (e.g. in ObjCExport
tests).

It seems that bitcode embedding also enables adhoc codesigning in the
linker.
The linker doesn't seem to do adhoc codesigning by default for tvOS
arm64 simulator target, and without a signature the binaries can't run
on the simulator.

So disabling bitcode embedding also disabled adhoc codesigning and made
the tests fail on that target.

Fix this by explicitly passing `-Xlinker -adhoc_codesign` when compiling
Swift code in tests.
2023-12-07 15:10:04 +00:00
Dmitriy Dolovov c9f4a1a841 IR: Avoid overwriting of property signature descriptions
^KT-64085
^KT-64082
2023-12-07 15:02:24 +00:00
Nataliya.Valtman 03cf13705e Support "beta + number" library versions
#KT-64122 Fixed
2023-12-07 14:14:50 +00:00
Dmitrii Gridin 97956b4374 [LL FIR] resolve propagated type annotations correctly
This commit is Low Level FIR part of changes around propagated
annotations (aka foreign annotations).
It includes such changes as:
* implicit type phase postpones foreign annotations resolution
* annotation arguments are requests resolution for postponed
annotations from implicit type phase as a pre-resolve step
* body resolve phase just calls lazy resolution for foreign annotations
on demand
* isResolved check for type annotations to be sure that all annotations
are resolved after annotation arguments phase

^KT-63042 Fixed
^KT-63681 Fixed
2023-12-07 12:26:40 +00:00
Dmitrii Gridin cf11e26755 [FIR] do not transform file annotation arguments before annotations phase
^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin daaf30e056 [LL FIR] introduce LLImplicitBodyResolveComputationSession
This class will be used in the next commit to have a custom logic
in Low Level FIR

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 9888cbbfcd [FIR] do not transform propagated annotations from place other than declaration side
We shouldn't transform annotations not from declaration side due to
a possible different context and to avoid unexpected transformation of
unrelated declarations

Example:
```kotlin
fun implicitType1() = TopLevelObject.expectedType()

object TopLevelObject {
    private const val privateConstVal = "privateConstVal"
    fun expectedType(): @Anno(privateConstVal) Int = 4
}
```
Here we will try to transform the annotation from `expectedType`
during `implicitType1` and as the result, we will see unresolved
reference on the declaration side. This commit fixes this issue.

This solution is based on the fact that the compiler anyway will
resolve the propagated annotation on the declaration side.
And it doesn't matter if it is resolved before or after the call site
declaration transformation, because as a global result, we will observe
that all declarations are resolved correctly in the right context.

Hence, this commit fixes the issue in the case of "full resolution"
which is true for the compiler, but it is not correct for Low Level
FIR where we resolve declarations on demand. It will be solved in
the next commits

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 6f0d52f991 [FIR] runAllPhasesForLocalClass: drop redundant annotations transformation
Such annotations will be transformed as usual in `FirDeclarationsResolveTransformer.transformRegularClass`.
Also, this transformation doesn't have a corresponding class as a container

^KT-63042
2023-12-07 12:26:40 +00:00