From ddc4fac896d5c4d1825a65faa97480efa546c94d Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Tue, 3 Oct 2023 16:17:51 +0200 Subject: [PATCH] [FIR] add missing transformation of type parameters during annotation arguments phase ^KT-56551 --- .../functionWithImplicitTypeAndAnnotations.txt | 8 ++++---- .../functionWithImplicitTypeAndAnnotationsScript.txt | 8 ++++---- .../plugin/FirAnnotationArgumentsResolveTransformer.kt | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt index febef6cbe68..302b1f00b0d 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt @@ -235,8 +235,8 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val typeParameterProperty: = LAZY_EXPRESSION - public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val valueParameterTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](functionProperty#) public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] fun <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) kotlin/Int|.function([ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] @R|myPack/Anno|[Types](parameterProperty#) param: R|@R|myPack/Anno|(valueParameterTypeProperty#) kotlin/Int| = LAZY_EXPRESSION): { LAZY_BLOCK } @@ -262,8 +262,8 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val typeParameterProperty: = LAZY_EXPRESSION - public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val valueParameterTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](functionProperty#) public final [ResolvedTo(CONTRACTS)] fun <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(CONTRACTS)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) kotlin/Int|.function([ResolvedTo(CONTRACTS)] @R|myPack/Anno|[Types](parameterProperty#) param: R|@R|myPack/Anno|(valueParameterTypeProperty#) kotlin/Int| = LAZY_EXPRESSION): { LAZY_BLOCK } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt index 6647247d0aa..9eb2e9758d7 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt @@ -349,8 +349,8 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotationsScript.kts @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val typeParameterProperty: = LAZY_EXPRESSION - public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val valueParameterTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @@ -389,8 +389,8 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotationsScript.kts @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val typeParameterProperty: = LAZY_EXPRESSION - public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val valueParameterTypeProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsResolveTransformer.kt index b1a34c0e2fa..be005b531f1 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsResolveTransformer.kt @@ -97,6 +97,7 @@ private class FirDeclarationsResolveTransformerForArgumentAnnotations( .transformReceiverParameter(transformer, data) .transformValueParameters(transformer, data) .transformAnnotations(transformer, data) + .transformTypeParameters(transformer, data) return simpleFunction }