Commit Graph

106841 Commits

Author SHA1 Message Date
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
Dmitrii Gridin a7afd1fe01 [FIR] ReturnTypeCalculatorWithJump: use outer transformer instead of type calculator
This is a more flexible solution

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin edb496f260 [FIR] BodyResolveContext: withFile should add container as well
This container will be used during an annotation call owner search

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin ed7415ab93 [FIR] BodyResolveContext: insideClassHeader should add container as well
This container will be used during an annotation call owner search

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin ec180bca71 [FIR] ImplicitBodyResolveComputationSession: encapsulate compute logic
This is required to simplify the code and have only one enter point

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 83bdac8d61 [FIR] CustomAnnotationTypeAttribute: drop containerSymbols
Now annotations have the container symbol itself, so this property
is no longer needed.
This migration fixes issues with a missed container symbol, so now
all cases of lazy resolution from KtType are supported

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 264a151676 [FIR] do not copy annotations during type propagation
We should share the original instance to be able to later resolve it in
the original context. This commit returns the KT-60387 problem, but the
root cause (concurrent modification) will be fixed in the context of
KT-63042

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 69559689fd [LL/FIR] add more resolve tests for declarations with annotations
^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 5bd1a97632 [FIR] LT builder: extract convertAnnotationList from convertModifierList
To simplify the logic around `convertModifierList` as a combination of
annotations and modifiers doesn't work well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin c5cba4c053 [FIR] builder: provide containingDeclarationSymbol
We cannot use only non-local declarations as anchors due to the same
resolution logic between member declarations of local classes, so we
have to support such cases as well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin be4bc81b1b [FIR] FirFileSymbol: add stable toString
It will be used in tests in the next commit

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 6eca9fe3a9 [FIR] tree: introduce containingDeclarationSymbol for annotation calls
This symbol will be used during resolution to avoid transformation
of annotations in the wrong context in the case of FIR node sharing.
The symbol should be some containing declaration symbol to be able
to answer the question "Are we own this annotation?" during resolution

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 1d5ab8c24f [FIR] builder: more tests for annotations
^KT-63042
2023-12-07 12:26:39 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Nikita Nazarov 0898dd1e7f [FIR] Don't check Java annotations for cycles
^KT-64083 fixed
2023-12-07 08:56:56 +00:00
Yan Zhulanow 1726a94c87 [Pill] Update module structure 2023-12-07 08:53:35 +00:00
Yan Zhulanow 7129bcc2b1 [Pill] Support production-on-test dependencies 2023-12-07 08:53:35 +00:00
Yan Zhulanow a7f6029076 [Pill] Delete obsolete run configurations 2023-12-07 08:53:35 +00:00
Yan Zhulanow d9a33b53ce [Pill] Update Kotlin source set fetching 2023-12-07 08:53:35 +00:00
Yan Zhulanow e4da639e1c [Pill] Remove 'jps-compatible' plugin from the root Kotlin project
'excludedDirs' definition is not needed anymore, so the plugin usage
is not really useful.
2023-12-07 08:53:35 +00:00
Yan Zhulanow d4153c1458 [Pill] Remove 'excludedDirs' usage from Pill extension
As it was the last usage of the Pill extension, it is going to be
removed in subsequent commits.
2023-12-07 08:53:35 +00:00
Yan Zhulanow e87ef36ef8 [Pill] Remove variant support from Pill, always import BASE modules
Pill variant configurations in build.gradle(.kts) files will be removed
in subsequent commits.
2023-12-07 08:53:35 +00:00
Yan Zhulanow 1fb8fb2324 [Pill] Do not import modules with the 'FULL' variant
The 'FULL' variant proved to be hardly useful for everyday work.
This change is the first step of removing the variant support from Pill.
2023-12-07 08:53:35 +00:00
Yan Zhulanow 63379b2c03 [Pill] Only add the 'jvmJar' artifact for the main source set 2023-12-07 08:53:34 +00:00
Yan Zhulanow 4e8a5eec7f [Pill] Support KMP 'jvmJar' task convention 2023-12-07 08:53:34 +00:00
Yan Zhulanow a508a650a5 [Pill] Include embedded dependencies together with the module itself 2023-12-07 08:53:34 +00:00
Yan Zhulanow a703fc0f17 [Pill] Remove obsolete IDE plugin artifact creation 2023-12-07 08:53:34 +00:00
Yan Zhulanow 680db7c317 [Pill] Allow kotlin_dom_api_compat artifact 2023-12-07 08:53:34 +00:00
Anton Lakotka 73b290a948 [Gradle] suppress DependencySources configurations in tests
PreHmppDependenciesDeprecationIT test checks that all configurations are
resolved without any error. However, *DependencySources configurations
by nature can't be resolved all the time. As not all dependencies have
sources variants published.
2023-12-07 08:42:35 +00:00
Anton Lakotka daa97f7ec9 [Gradle] Fix testResolveAllConfigurations
It should exclude certain kotlin source set configurations, that
can't be resolved all the time for various reasons.

Particularly `dependencySources` since not all dependencies has
published source variants.
2023-12-07 08:42:35 +00:00
Anton Lakotka c979e4e7be [Gradle] Add dependencySourcesConfigurationName to DefaultKotlinSourceSet
Move logic that creates configuration to resolve Dependency Sources
to SourceSet factory from IDE resolver. Because when it is created
during IDE import it will be reported as a warning. Since all
configurations and tasks must be created before IDE import starts.

^KT-63226 Verification Pending
2023-12-07 08:42:35 +00:00
Anton Lakotka 1d4bca56b1 [Gradle] Set min version for source resolver test to Gradle 7.2
Earlier versions of gradle doesn't return capabilities in resolved
artifact view. Therefore, it is not possible to match artifact by
cooridnates + capabilities.

^KT-63226
2023-12-07 08:42:35 +00:00
Anton Lakotka e2dafa2580 [Gradle] Implement variant base source resolver for IDE
^KT-63226 In Progress
2023-12-07 08:42:35 +00:00
Anton Lakotka 7c9505d9b6 [Gradle] Sources resolver test for multiple capabilities
If dependency has more than one capability sources still can be
resolved.

^KT-63226 In Progress
2023-12-07 08:42:35 +00:00
Roman Golyshev f266a44356 KT-64080 [LL] Resolve super calls to BODY_RESOLVE for on-air resolve
^KT-64080 Fixed
2023-12-07 01:26:23 +01:00
Roman Golyshev 3c7dfc0e5b KT-64080 [LL] Use nullable receiver overload for isAncestor function
This simplifies the `bodyResolveRequired` a lot
2023-12-07 00:41:55 +01:00