From 9fdd3dc53fa03a665a6b438f8bc99a39870282df Mon Sep 17 00:00:00 2001 From: Igor Yakovlev Date: Thu, 29 Jul 2021 18:16:22 +0200 Subject: [PATCH] [FIR IDE] Add support of lazy phase for annotation arguments --- ...irAnnotationArgumentsResolveTransformer.kt | 2 +- .../FirLazyDeclarationResolveToType.kt | 3 +- ...tationArgumentsResolveTransformerForIDE.kt | 86 ++ ...esignatedStatusResolveTransformerForIDE.kt | 2 +- .../transformers/LazyTransformerFactory.kt | 5 + .../lazyResolve/annotationParameters.kt | 15 + .../lazyResolve/annotationParameters.txt | 739 ++++++++++++++++++ .../testdata/lazyResolve/annotations.txt | 8 +- .../testdata/lazyResolve/classMembers.txt | 41 +- .../testdata/lazyResolve/delegates.txt | 98 ++- .../lazyResolve/functionWithParameter.txt | 12 +- .../testdata/lazyResolve/localDeclaration.txt | 22 + .../testdata/lazyResolve/localFunction.txt | 15 + .../lazyResolve/parameterOfLocalSetter.txt | 18 + .../lazyResolve/parameterOfNonLocalSetter.txt | 27 +- .../lazyResolve/propertyWithGetter.txt | 22 +- .../propertyWithGetterAndSetter.txt | 30 +- .../lazyResolve/propertyWithInitializer.txt | 16 +- .../lazyResolve/secondaryConstructor.txt | 25 +- .../testdata/lazyResolve/superTypes.txt | 29 +- .../testdata/lazyResolve/superTypesLoop.txt | 37 +- .../lazyResolve/topLevelFunctions.txt | 19 +- ...tionsWithExpressionBodyAndExplicitType.txt | 19 +- .../topLevelFunctionsWithImplicitType.txt | 19 +- .../typeParameterOfLocalFunction.txt | 8 + .../typeParameterOfNonLocalFunction.txt | 18 +- .../typeParameterOfTopFunction.txt | 7 +- .../lazyResolve/typeParameterOfTopSetter.txt | 16 +- ...irLazyDeclarationResolveTestGenerated.java | 6 + 29 files changed, 1269 insertions(+), 95 deletions(-) create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedAnnotationArgumentsResolveTransformerForIDE.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.txt 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 5e0fec43f54..ecc1c61cc47 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 @@ -16,7 +16,7 @@ import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolve import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirExpressionsResolveTransformer -class FirAnnotationArgumentsResolveTransformer( +open class FirAnnotationArgumentsResolveTransformer( session: FirSession, scopeSession: ScopeSession, outerBodyResolveContext: BodyResolveContext? = null diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolveToType.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolveToType.kt index be280b1a68d..5599b6e1155 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolveToType.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/FirLazyDeclarationResolveToType.kt @@ -85,7 +85,8 @@ internal fun FirLazyDeclarationResolver.lazyResolveDeclaration( checkPCE = checkPCE ) } else { - val toPhase = if (toResolveType == ResolveType.AnnotationType) FirResolvePhase.TYPES else FirResolvePhase.BODY_RESOLVE + val toPhase = + if (toResolveType == ResolveType.AnnotationType) FirResolvePhase.TYPES else FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS lazyResolveDeclaration( firDeclarationToResolve = firDeclaration, moduleFileCache = moduleFileCache, diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedAnnotationArgumentsResolveTransformerForIDE.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedAnnotationArgumentsResolveTransformerForIDE.kt new file mode 100644 index 00000000000..8299ec15d97 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedAnnotationArgumentsResolveTransformerForIDE.kt @@ -0,0 +1,86 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.transformers + +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.expressions.FirAnnotationResolveStatus +import org.jetbrains.kotlin.fir.resolve.ResolutionMode +import org.jetbrains.kotlin.fir.resolve.ScopeSession +import org.jetbrains.kotlin.fir.resolve.transformers.plugin.FirAnnotationArgumentsResolveTransformer +import org.jetbrains.kotlin.idea.fir.low.level.api.FirPhaseRunner +import org.jetbrains.kotlin.idea.fir.low.level.api.api.FirDeclarationDesignationWithFile +import org.jetbrains.kotlin.idea.fir.low.level.api.util.ensurePhase + +internal class FirDesignatedAnnotationArgumentsResolveTransformerForIDE( + private val designation: FirDeclarationDesignationWithFile, + session: FirSession, + scopeSession: ScopeSession, +) : FirLazyTransformerForIDE, FirAnnotationArgumentsResolveTransformer(session, scopeSession) { + + private fun moveNextDeclaration(designationIterator: Iterator) { + if (!designationIterator.hasNext()) { + designation.declaration.transform(declarationsTransformer, ResolutionMode.ContextIndependent) + return + } + when (val nextElement = designationIterator.next()) { + is FirFile -> { + context.withFile(nextElement, components) { + moveNextDeclaration(designationIterator) + } + } + is FirRegularClass -> { + context.withContainingClass(nextElement) { + moveNextDeclaration(designationIterator) + } + } + is FirEnumEntry -> { + context.forEnumEntry { + moveNextDeclaration(designationIterator) + } + } + else -> { + error("Unexpected declaration in designation: ${nextElement::class.qualifiedName}") + } + } + } + + override fun transformDeclaration(phaseRunner: FirPhaseRunner) { + if (designation.declaration.resolvePhase >= FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) return + designation.declaration.ensurePhase(FirResolvePhase.TYPES) + + val designationIterator = designation.toSequenceWithFile(includeTarget = false).iterator() + + phaseRunner.runPhaseWithCustomResolve(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) { + moveNextDeclaration(designationIterator) + } + + FirLazyTransformerForIDE.updatePhaseDeep(designation.declaration, FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) + ensureResolved(designation.declaration) + ensureResolvedDeep(designation.declaration) + } + + override fun ensureResolved(declaration: FirDeclaration) { + if (declaration is FirAnnotatedDeclaration) { + val unresolvedAnnotation = declaration.annotations.firstOrNull { it.resolveStatus == FirAnnotationResolveStatus.Resolved } + check(unresolvedAnnotation == null) { + "Unexpected resolve status of annotation, expected Resolved but actual $unresolvedAnnotation" + } + } + when (declaration) { + is FirSimpleFunction, is FirConstructor, is FirAnonymousInitializer -> + declaration.ensurePhase(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) + is FirProperty -> { + declaration.ensurePhase(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) +// declaration.getter?.ensurePhase(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) +// declaration.setter?.ensurePhase(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) + } + is FirClass, is FirTypeAlias, is FirEnumEntry, is FirField -> Unit + else -> error("Unexpected type: ${declaration::class.simpleName}") + } + } + +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedStatusResolveTransformerForIDE.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedStatusResolveTransformerForIDE.kt index e8fb4dd0d44..8a493a1ef4a 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedStatusResolveTransformerForIDE.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/FirDesignatedStatusResolveTransformerForIDE.kt @@ -37,7 +37,7 @@ internal class FirDesignatedStatusResolveTransformerForIDE( override fun transformDeclaration(phaseRunner: FirPhaseRunner) { if (designation.declaration.resolvePhase >= FirResolvePhase.STATUS) return - designation.declaration.ensurePhase(FirResolvePhase.TYPES) + designation.declaration.ensurePhase(FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS) val transformer = FirDesignatedStatusResolveTransformerForIDE() phaseRunner.runPhaseWithCustomResolve(FirResolvePhase.STATUS) { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/LazyTransformerFactory.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/LazyTransformerFactory.kt index a474021e5cb..1fdf29af6e5 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/LazyTransformerFactory.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/transformers/LazyTransformerFactory.kt @@ -39,6 +39,11 @@ internal object LazyTransformerFactory { designation.firFile.moduleData.session, scopeSession, ) + FirResolvePhase.ARGUMENTS_OF_ANNOTATIONS -> FirDesignatedAnnotationArgumentsResolveTransformerForIDE( + designation, + designation.firFile.moduleData.session, + scopeSession, + ) FirResolvePhase.STATUS -> FirDesignatedStatusResolveTransformerForIDE( designation, designation.firFile.moduleData.session, diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.kt new file mode 100644 index 00000000000..7b1eccc1358 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.kt @@ -0,0 +1,15 @@ +enum class X { + A +} + +annotation class Anno(val args: A.X) + +class B { + @Anno(X.A) + fun resolveMe() { + } + + @Anno(X.A) + fun foo() { + } +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.txt new file mode 100644 index 00000000000..f53cc28c891 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.txt @@ -0,0 +1,739 @@ +RAW_FIR: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [RAW_FIR] class B : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun foo(): R|kotlin/Unit| { + } + + } + +IMPORTS: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [RAW_FIR] class B : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun foo(): R|kotlin/Unit| { + } + + } + +SUPER_TYPES: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [RAW_FIR] class B : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun foo(): R|kotlin/Unit| { + } + + } + +TYPES: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(X#.A#) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +STATUS: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +CONTRACTS: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [CONTRACTS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [STATUS] class B : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [IMPLICIT_TYPES_BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun foo(): R|kotlin/Unit| { + } + + } + +BODY_RESOLVE: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public final [SUPER_TYPES] annotation class Anno : R|kotlin/Annotation| { + public [STATUS] [ContainingClassKey=Anno] constructor([RAW_FIR] args: ): R|Anno| { + super() + } + + public? final? [SUPER_TYPES] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [STATUS] class B : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun foo(): R|kotlin/Unit| { + } + + } + +NoResolve: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [RAW_FIR] class B : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun foo(): R|kotlin/Unit| { + } + + } + +BodyResolveWithChildren: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public final [SUPER_TYPES] annotation class Anno : R|kotlin/Annotation| { + public [STATUS] [ContainingClassKey=Anno] constructor([RAW_FIR] args: ): R|Anno| { + super() + } + + public? final? [SUPER_TYPES] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [STATUS] class B : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun foo(): R|kotlin/Unit| { + } + + } + +CallableBodyResolve: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public final [SUPER_TYPES] annotation class Anno : R|kotlin/Annotation| { + public [STATUS] [ContainingClassKey=Anno] constructor([RAW_FIR] args: ): R|Anno| { + super() + } + + public? final? [SUPER_TYPES] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [STATUS] class B : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun foo(): R|kotlin/Unit| { + } + + } + +CallableReturnType: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [RAW_FIR] class B : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [RAW_FIR] fun foo(): R|kotlin/Unit| { + } + + } + +AnnotationType: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(X#.A#) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +AnnotationsArguments: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +CallableContracts: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [CONTRACTS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +DeclarationStatus: +FILE: annotationParameters.kt + public final [STATUS] enum class X : R|kotlin/Enum| { + private [STATUS] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [STATUS] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public final [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [STATUS] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +ValueParametersTypes: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(X#.A#) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +TypeParametersTypes: +FILE: annotationParameters.kt + public? final? [RAW_FIR] enum class X : R|kotlin/Enum| { + private [RAW_FIR] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [RAW_FIR] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public? final? [RAW_FIR] annotation class Anno : R|kotlin/Annotation| { + public? [RAW_FIR] [ContainingClassKey=Anno] constructor([RAW_FIR] args: A.X): R|Anno| { + super() + } + + public? final? [RAW_FIR] [IsFromPrimaryConstructor=true] val args: A.X = R|/args| + [TYPES] public? get(): A.X + + } + public? final? [SUPER_TYPES] class B : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(X#.A#) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { + } + + @Anno(X#.A#) public? final? [SUPER_TYPES] fun foo(): R|kotlin/Unit| { + } + + } + +FILE RAW TO BODY: +FILE: annotationParameters.kt + public final [BODY_RESOLVE] enum class X : R|kotlin/Enum| { + private [BODY_RESOLVE] [ContainingClassKey=X] constructor(): R|X| { + super|>() + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] enum entry A: R|X| + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun values(): R|kotlin/Array| { + } + + public final static [BODY_RESOLVE] [ContainingClassKey=X] fun valueOf([BODY_RESOLVE] value: R|kotlin/String|): R|X| { + } + + } + public final [BODY_RESOLVE] annotation class Anno : R|kotlin/Annotation| { + public [BODY_RESOLVE] [ContainingClassKey=Anno] constructor([BODY_RESOLVE] args: ): R|Anno| { + super() + } + + public final [BODY_RESOLVE] [IsFromPrimaryConstructor=true] val args: = R|/args| + [BODY_RESOLVE] public get(): + + } + public final [BODY_RESOLVE] class B : R|kotlin/Any| { + public [BODY_RESOLVE] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + @R|Anno|(Q|X|.R|/X.A|) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + @R|Anno|(Q|X|.R|/X.A|) public final [BODY_RESOLVE] fun foo(): R|kotlin/Unit| { + } + + } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotations.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotations.txt index 6ed37186d49..234d9dfd98d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotations.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotations.txt @@ -22,6 +22,12 @@ FILE: annotations.kt @R|kotlin/Suppress|(String(2)) public? final? [TYPES] fun resolveMe(): R|kotlin/Unit| { } +ARGUMENTS_OF_ANNOTATIONS: +FILE: annotations.kt + @FILE:Suppress(String(1)) + @R|kotlin/Suppress|(String(2)) public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + } + STATUS: FILE: annotations.kt @FILE:Suppress(String(1)) @@ -79,7 +85,7 @@ FILE: annotations.kt AnnotationsArguments: FILE: annotations.kt @FILE:Suppress(String(1)) - @R|kotlin/Suppress|(vararg(String(2))) public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + @R|kotlin/Suppress|(String(2)) public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { } CallableContracts: diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/classMembers.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/classMembers.txt index 2f141f3abb5..271f6437d8d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/classMembers.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/classMembers.txt @@ -98,6 +98,31 @@ FILE: classMembers.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: classMembers.kt + public? final? [SUPER_TYPES] class A : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=A] constructor(): R|A| { + super() + } + + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) + } + + public? final? [SUPER_TYPES] val x: Int = IntegerLiteral(10) + [SUPER_TYPES] [ContainingClassKey=A] public? get(): Int { + ^ field# + } + + public? final? [SUPER_TYPES] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { + } + + public? final? [SUPER_TYPES] fun functionWithLazyBody(): String { + ^functionWithLazyBody String(42) + } + + } + STATUS: FILE: classMembers.kt public final [SUPER_TYPES] class A : R|kotlin/Any| { @@ -325,24 +350,24 @@ FILE: classMembers.kt AnnotationsArguments: FILE: classMembers.kt - public final [STATUS] class A : R|kotlin/Any| { - public [STATUS] [ContainingClassKey=A] constructor(): R|A| { + public? final? [SUPER_TYPES] class A : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=A] constructor(): R|A| { super() } - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - this@R|/A|.R|/A.receive|(this@R|/A|.R|/A.functionWithLazyBody|()) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) } - public final [STATUS] val x: R|kotlin/Int| = IntegerLiteral(10) - [STATUS] [ContainingClassKey=A] public get(): R|kotlin/Int| { + public? final? [SUPER_TYPES] val x: Int = IntegerLiteral(10) + [SUPER_TYPES] [ContainingClassKey=A] public? get(): Int { ^ field# } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/String|): R|kotlin/Unit| { + public? final? [SUPER_TYPES] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { } - public final [STATUS] fun functionWithLazyBody(): R|kotlin/String| { + public? final? [SUPER_TYPES] fun functionWithLazyBody(): String { ^functionWithLazyBody String(42) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/delegates.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/delegates.txt index af2a915f289..e16b0602c9c 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/delegates.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/delegates.txt @@ -190,6 +190,54 @@ FILE: delegates.kt D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } +ARGUMENTS_OF_ANNOTATIONS: +FILE: delegates.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(valueWithExplicitType#) + receive#(valueWithImplicitType#) + variableWithExplicitType# = IntegerLiteral(10) + variableWithImplicitType# = IntegerLiteral(10) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { + } + public? final? [RAW_FIR] val delegate: = object : ReadWriteProperty { + private [RAW_FIR] [ContainingClassKey=] constructor(): R|| { + super<>() + } + + public? open? override [RAW_FIR] fun getValue([RAW_FIR] thisRef: Any?, [RAW_FIR] property: KProperty<*>): Int { + ^getValue IntegerLiteral(1) + } + + public? open? override [RAW_FIR] fun setValue([RAW_FIR] thisRef: Any?, [RAW_FIR] property: KProperty<*>, [RAW_FIR] value: Int): R|kotlin/Unit| { + } + + } + + [TYPES] public? get(): + public? final? [RAW_FIR] val valueWithExplicitType: Intby delegate# + [RAW_FIR] public? get(): { + ^ D|/valueWithExplicitType|.getValue#(Null(null), ::R|/valueWithExplicitType|) + } + public? final? [RAW_FIR] val valueWithImplicitType: by delegate# + [RAW_FIR] public? get(): { + ^ D|/valueWithImplicitType|.getValue#(Null(null), ::R|/valueWithImplicitType|) + } + public? final? [RAW_FIR] var variableWithExplicitType: Intby delegate# + [RAW_FIR] public? get(): { + ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) + } + [RAW_FIR] public? set([RAW_FIR] : ): R|kotlin/Unit| { + D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + } + public? final? [RAW_FIR] var variableWithImplicitType: by delegate# + [RAW_FIR] public? get(): { + ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) + } + [RAW_FIR] public? set([RAW_FIR] : ): R|kotlin/Unit| { + D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + } + STATUS: FILE: delegates.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -624,50 +672,50 @@ FILE: delegates.kt AnnotationsArguments: FILE: delegates.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/valueWithExplicitType|) - R|/receive|(R|/valueWithImplicitType|) - R|/variableWithExplicitType| = Int(10) - R|/variableWithImplicitType| = Int(10) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(valueWithExplicitType#) + receive#(valueWithImplicitType#) + variableWithExplicitType# = IntegerLiteral(10) + variableWithImplicitType# = IntegerLiteral(10) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/Int|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { } - public final [STATUS] val delegate: R|kotlin/properties/ReadWriteProperty| = object : R|kotlin/properties/ReadWriteProperty| { + public? final? [RAW_FIR] val delegate: = object : ReadWriteProperty { private [RAW_FIR] [ContainingClassKey=] constructor(): R|| { - super() + super<>() } - public final override operator [RAW_FIR] fun getValue([RAW_FIR] thisRef: R|kotlin/Any?|, [RAW_FIR] property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| { - ^getValue Int(1) + public? open? override [RAW_FIR] fun getValue([RAW_FIR] thisRef: Any?, [RAW_FIR] property: KProperty<*>): Int { + ^getValue IntegerLiteral(1) } - public final override operator [RAW_FIR] fun setValue([RAW_FIR] thisRef: R|kotlin/Any?|, [RAW_FIR] property: R|kotlin/reflect/KProperty<*>|, [RAW_FIR] value: R|kotlin/Int|): R|kotlin/Unit| { + public? open? override [RAW_FIR] fun setValue([RAW_FIR] thisRef: Any?, [RAW_FIR] property: KProperty<*>, [RAW_FIR] value: Int): R|kotlin/Unit| { } } - [BODY_RESOLVE] public get(): R|kotlin/properties/ReadWriteProperty| - public final [STATUS] val valueWithExplicitType: R|kotlin/Int|by delegate# - [STATUS] public get(): { + [TYPES] public? get(): + public? final? [RAW_FIR] val valueWithExplicitType: Intby delegate# + [RAW_FIR] public? get(): { ^ D|/valueWithExplicitType|.getValue#(Null(null), ::R|/valueWithExplicitType|) } - public final [IMPLICIT_TYPES_BODY_RESOLVE] val valueWithImplicitType: R|kotlin/Int|by R|/delegate| - [IMPLICIT_TYPES_BODY_RESOLVE] public get(): R|kotlin/Int| { - ^ D|/valueWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/valueWithImplicitType|) + public? final? [RAW_FIR] val valueWithImplicitType: by delegate# + [RAW_FIR] public? get(): { + ^ D|/valueWithImplicitType|.getValue#(Null(null), ::R|/valueWithImplicitType|) } - public final [STATUS] var variableWithExplicitType: R|kotlin/Int|by delegate# - [STATUS] public get(): { + public? final? [RAW_FIR] var variableWithExplicitType: Intby delegate# + [RAW_FIR] public? get(): { ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } - [STATUS] public set([RAW_FIR] : ): R|kotlin/Unit| { + [RAW_FIR] public? set([RAW_FIR] : ): R|kotlin/Unit| { D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } - public final [IMPLICIT_TYPES_BODY_RESOLVE] var variableWithImplicitType: R|kotlin/Int|by R|/delegate| - [IMPLICIT_TYPES_BODY_RESOLVE] public get(): R|kotlin/Int| { - ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|) + public? final? [RAW_FIR] var variableWithImplicitType: by delegate# + [RAW_FIR] public? get(): { + ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } - [IMPLICIT_TYPES_BODY_RESOLVE] public set([RAW_FIR] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + [RAW_FIR] public? set([RAW_FIR] : ): R|kotlin/Unit| { + D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } CallableContracts: diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/functionWithParameter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/functionWithParameter.txt index 402a0920e91..b024870b1a2 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/functionWithParameter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/functionWithParameter.txt @@ -30,6 +30,14 @@ FILE: functionWithParameter.kt ^resolveMe Unit# } +ARGUMENTS_OF_ANNOTATIONS: +FILE: functionWithParameter.kt + public? final? [RAW_FIR] interface I : R|kotlin/Any| { + } + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe([RAW_FIR] param: R|I|): { + ^resolveMe Unit# + } + STATUS: FILE: functionWithParameter.kt public? final? [RAW_FIR] interface I : R|kotlin/Any| { @@ -106,8 +114,8 @@ AnnotationsArguments: FILE: functionWithParameter.kt public? final? [RAW_FIR] interface I : R|kotlin/Any| { } - public final [BODY_RESOLVE] fun resolveMe([BODY_RESOLVE] param: R|I|): R|kotlin/Unit| { - ^resolveMe Q|kotlin/Unit| + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe([RAW_FIR] param: R|I|): { + ^resolveMe Unit# } CallableContracts: diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localDeclaration.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localDeclaration.txt index 3f47ed35d2a..06566327ed1 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localDeclaration.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localDeclaration.txt @@ -86,6 +86,28 @@ FILE: localDeclaration.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: localDeclaration.kt + public final [STATUS] class A : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=A] constructor(): R|A| { + super() + } + + public final [BODY_RESOLVE] fun x(): R|kotlin/Unit| { + local final [BODY_RESOLVE] [ContainingClassKey=A] class resolveMe : R|kotlin/Any| { + public [BODY_RESOLVE] [ContainingClassKey=resolveMe] constructor(): R|A.resolveMe| { + super() + } + + public final [BODY_RESOLVE] val e: R|kotlin/Int| = Int(2) + [BODY_RESOLVE] [ContainingClassKey=resolveMe] public get(): R|kotlin/Int| + + } + + } + + } + STATUS: FILE: localDeclaration.kt public final [STATUS] class A : R|kotlin/Any| { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localFunction.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localFunction.txt index b78de97e284..d871c9837a3 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localFunction.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/localFunction.txt @@ -58,6 +58,21 @@ FILE: localFunction.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: localFunction.kt + public final [STATUS] class A : R|kotlin/Any| { + public [STATUS] [ContainingClassKey=A] constructor(): R|A| { + super() + } + + public final [BODY_RESOLVE] fun x(): R|kotlin/Unit| { + local final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { + } + + } + + } + STATUS: FILE: localFunction.kt public final [STATUS] class A : R|kotlin/Any| { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfLocalSetter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfLocalSetter.txt index 826d435a0c5..7672708351a 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfLocalSetter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfLocalSetter.txt @@ -70,6 +70,24 @@ FILE: parameterOfLocalSetter.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: parameterOfLocalSetter.kt + public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { + local final [BODY_RESOLVE] class XX : R|kotlin/Any| { + public [BODY_RESOLVE] [ContainingClassKey=XX] constructor(): R|XX| { + super() + } + + public final [BODY_RESOLVE] var x: R|kotlin/Int| = Int(2) + [BODY_RESOLVE] [ContainingClassKey=XX] public get(): R|kotlin/Int| + [BODY_RESOLVE] [ContainingClassKey=XX] public set([BODY_RESOLVE] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { + ^ Q|kotlin/Unit| + } + + } + + } + STATUS: FILE: parameterOfLocalSetter.kt public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfNonLocalSetter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfNonLocalSetter.txt index 4636f662f3d..87cd05c7d31 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfNonLocalSetter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/parameterOfNonLocalSetter.txt @@ -58,6 +58,21 @@ FILE: parameterOfNonLocalSetter.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: parameterOfNonLocalSetter.kt + public? final? [SUPER_TYPES] class X : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=X] constructor(): R|X| { + super() + } + + public? final? [ARGUMENTS_OF_ANNOTATIONS] var x: R|kotlin/Int| = IntegerLiteral(2) + [TYPES] [ContainingClassKey=X] public? get(): R|kotlin/Int| + [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=X] public? set([RAW_FIR] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { + ^ Unit# + } + + } + STATUS: FILE: parameterOfNonLocalSetter.kt public final [SUPER_TYPES] class X : R|kotlin/Any| { @@ -195,15 +210,15 @@ FILE: parameterOfNonLocalSetter.kt AnnotationsArguments: FILE: parameterOfNonLocalSetter.kt - public final [STATUS] class X : R|kotlin/Any| { - public [STATUS] [ContainingClassKey=X] constructor(): R|X| { + public? final? [SUPER_TYPES] class X : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=X] constructor(): R|X| { super() } - public final [BODY_RESOLVE] var x: R|kotlin/Int| = Int(2) - [BODY_RESOLVE] [ContainingClassKey=X] public get(): R|kotlin/Int| - [BODY_RESOLVE] [ContainingClassKey=X] public set([BODY_RESOLVE] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { - ^ Q|kotlin/Unit| + public? final? [ARGUMENTS_OF_ANNOTATIONS] var x: R|kotlin/Int| = IntegerLiteral(2) + [TYPES] [ContainingClassKey=X] public? get(): R|kotlin/Int| + [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=X] public? set([RAW_FIR] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { + ^ Unit# } } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetter.txt index db68edcc5cd..8f49958f62d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetter.txt @@ -46,6 +46,18 @@ FILE: propertyWithGetter.kt ^ IntegerLiteral(42) } +ARGUMENTS_OF_ANNOTATIONS: +FILE: propertyWithGetter.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(withGetter#) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { + } + public? final? [RAW_FIR] val withGetter: Int + [RAW_FIR] public? get(): Int { + ^ IntegerLiteral(42) + } + STATUS: FILE: propertyWithGetter.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -156,13 +168,13 @@ FILE: propertyWithGetter.kt AnnotationsArguments: FILE: propertyWithGetter.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/withGetter|) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(withGetter#) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/Int|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { } - public final [STATUS] val withGetter: R|kotlin/Int| - [STATUS] public get(): R|kotlin/Int| { + public? final? [RAW_FIR] val withGetter: Int + [RAW_FIR] public? get(): Int { ^ IntegerLiteral(42) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetterAndSetter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetterAndSetter.txt index 314b065189e..3ed62522ce3 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetterAndSetter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithGetterAndSetter.txt @@ -62,6 +62,22 @@ FILE: propertyWithGetterAndSetter.kt field# = value# } +ARGUMENTS_OF_ANNOTATIONS: +FILE: propertyWithGetterAndSetter.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(withGetterAndSetter#) + withGetterAndSetter# = IntegerLiteral(123) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { + } + public? final? [RAW_FIR] var withGetterAndSetter: Int = IntegerLiteral(42) + [RAW_FIR] public? get(): Int { + ^ field# + } + [RAW_FIR] public? set([RAW_FIR] value: Int): R|kotlin/Unit| { + field# = value# + } + STATUS: FILE: propertyWithGetterAndSetter.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -208,17 +224,17 @@ FILE: propertyWithGetterAndSetter.kt AnnotationsArguments: FILE: propertyWithGetterAndSetter.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/withGetterAndSetter|) - R|/withGetterAndSetter| = Int(123) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(withGetterAndSetter#) + withGetterAndSetter# = IntegerLiteral(123) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/Int|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: Int): R|kotlin/Unit| { } - public final [STATUS] var withGetterAndSetter: R|kotlin/Int| = IntegerLiteral(42) - [STATUS] public get(): R|kotlin/Int| { + public? final? [RAW_FIR] var withGetterAndSetter: Int = IntegerLiteral(42) + [RAW_FIR] public? get(): Int { ^ field# } - [STATUS] public set([RAW_FIR] value: R|kotlin/Int|): R|kotlin/Unit| { + [RAW_FIR] public? set([RAW_FIR] value: Int): R|kotlin/Unit| { field# = value# } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithInitializer.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithInitializer.txt index 9b5de7d0c6c..de0c338a2e7 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithInitializer.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/propertyWithInitializer.txt @@ -30,6 +30,14 @@ FILE: propertyWithInitializer.kt public? final? [RAW_FIR] val property: Int = IntegerLiteral(10) [TYPES] public? get(): Int +ARGUMENTS_OF_ANNOTATIONS: +FILE: propertyWithInitializer.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(property#) + } + public? final? [RAW_FIR] val property: Int = IntegerLiteral(10) + [TYPES] public? get(): Int + STATUS: FILE: propertyWithInitializer.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -104,11 +112,11 @@ FILE: propertyWithInitializer.kt AnnotationsArguments: FILE: propertyWithInitializer.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - #(R|/property|) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(property#) } - public final [STATUS] val property: R|kotlin/Int| = IntegerLiteral(10) - [BODY_RESOLVE] public get(): R|kotlin/Int| + public? final? [RAW_FIR] val property: Int = IntegerLiteral(10) + [TYPES] public? get(): Int CallableContracts: FILE: propertyWithInitializer.kt diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/secondaryConstructor.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/secondaryConstructor.txt index 3be9f2b225d..76510c6d0d6 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/secondaryConstructor.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/secondaryConstructor.txt @@ -58,6 +58,21 @@ FILE: secondaryConstructor.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: secondaryConstructor.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(A#(IntegerLiteral(42))) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: A): R|kotlin/Unit| { + } + public? final? [RAW_FIR] class A : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=A] constructor([RAW_FIR] x: Int): R|A| { + super() + [RAW_FIR] lval a: = x# + } + + } + STATUS: FILE: secondaryConstructor.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -195,13 +210,13 @@ FILE: secondaryConstructor.kt AnnotationsArguments: FILE: secondaryConstructor.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/A.A|(Int(42))) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(A#(IntegerLiteral(42))) } - public final [STATUS] fun receive([RAW_FIR] value: R|A|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: A): R|kotlin/Unit| { } - public final [STATUS] class A : R|kotlin/Any| { - public [STATUS] [ContainingClassKey=A] constructor([RAW_FIR] x: R|kotlin/Int|): R|A| { + public? final? [RAW_FIR] class A : R|kotlin/Any| { + public? [RAW_FIR] [ContainingClassKey=A] constructor([RAW_FIR] x: Int): R|A| { super() [RAW_FIR] lval a: = x# } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypes.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypes.txt index 868a7a909df..8e1506d28c1 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypes.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypes.txt @@ -82,6 +82,27 @@ FILE: superTypes.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: superTypes.kt + public? open [SUPER_TYPES] class A : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=A] constructor(): R|A| { + super() + } + + } + public? open [RAW_FIR] class B : A { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + } + public? open [ARGUMENTS_OF_ANNOTATIONS] class resolveMe : R|A| { + public? [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { + super() + } + + } + STATUS: FILE: superTypes.kt public open [TYPES] class A : R|kotlin/Any| { @@ -231,8 +252,8 @@ FILE: superTypes.kt AnnotationsArguments: FILE: superTypes.kt - public open [STATUS] class A : R|kotlin/Any| { - public [STATUS] [ContainingClassKey=A] constructor(): R|A| { + public? open [SUPER_TYPES] class A : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=A] constructor(): R|A| { super() } @@ -243,8 +264,8 @@ FILE: superTypes.kt } } - public open [BODY_RESOLVE] class resolveMe : R|A| { - public [BODY_RESOLVE] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { + public? open [ARGUMENTS_OF_ANNOTATIONS] class resolveMe : R|A| { + public? [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { super() } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypesLoop.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypesLoop.txt index d5cfba95254..2c9d95faf1b 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypesLoop.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/superTypesLoop.txt @@ -106,6 +106,33 @@ FILE: superTypesLoop.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: superTypesLoop.kt + public? open [ARGUMENTS_OF_ANNOTATIONS] class resolveMe : R|C| { + public? [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { + super() + } + + } + public? open [RAW_FIR] class A : /B> { + public? [RAW_FIR] [ContainingClassKey=A] constructor(): R|A| { + super() + } + + } + public? open [RAW_FIR] class B : /C> { + public? [RAW_FIR] [ContainingClassKey=B] constructor(): R|B| { + super() + } + + } + public? open [SUPER_TYPES] class C : /A> { + public? [SUPER_TYPES] [ContainingClassKey=C] constructor(): R|C| { + super() + } + + } + STATUS: FILE: superTypesLoop.kt public open [STATUS] class resolveMe : R|C| { @@ -297,8 +324,8 @@ FILE: superTypesLoop.kt AnnotationsArguments: FILE: superTypesLoop.kt - public open [BODY_RESOLVE] class resolveMe : R|C| { - public [BODY_RESOLVE] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { + public? open [ARGUMENTS_OF_ANNOTATIONS] class resolveMe : R|C| { + public? [ARGUMENTS_OF_ANNOTATIONS] [ContainingClassKey=resolveMe] constructor(): R|resolveMe| { super() } @@ -315,9 +342,9 @@ FILE: superTypesLoop.kt } } - public open [STATUS] class C : /A> { - public [STATUS] [ContainingClassKey=C] constructor(): R|C| { - super() + public? open [SUPER_TYPES] class C : /A> { + public? [SUPER_TYPES] [ContainingClassKey=C] constructor(): R|C| { + super() } } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctions.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctions.txt index 619d983efc0..7056b7d5596 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctions.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctions.txt @@ -42,6 +42,17 @@ FILE: topLevelFunctions.kt ^functionWithLazyBody String(42) } +ARGUMENTS_OF_ANNOTATIONS: +FILE: topLevelFunctions.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { + } + public? final? [RAW_FIR] fun functionWithLazyBody(): String { + ^functionWithLazyBody String(42) + } + STATUS: FILE: topLevelFunctions.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -143,12 +154,12 @@ FILE: topLevelFunctions.kt AnnotationsArguments: FILE: topLevelFunctions.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/functionWithLazyBody|()) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/String|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { } - public final [STATUS] fun functionWithLazyBody(): R|kotlin/String| { + public? final? [RAW_FIR] fun functionWithLazyBody(): String { ^functionWithLazyBody String(42) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithExpressionBodyAndExplicitType.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithExpressionBodyAndExplicitType.txt index ab38ab8867c..97566552bce 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithExpressionBodyAndExplicitType.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithExpressionBodyAndExplicitType.txt @@ -42,6 +42,17 @@ FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt ^functionWithLazyBody String(42) } +ARGUMENTS_OF_ANNOTATIONS: +FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { + } + public? final? [RAW_FIR] fun functionWithLazyBody(): String { + ^functionWithLazyBody String(42) + } + STATUS: FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -143,12 +154,12 @@ FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt AnnotationsArguments: FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/functionWithLazyBody|()) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/String|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { } - public final [STATUS] fun functionWithLazyBody(): R|kotlin/String| { + public? final? [RAW_FIR] fun functionWithLazyBody(): String { ^functionWithLazyBody String(42) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithImplicitType.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithImplicitType.txt index 324e94eb5d1..7fb382513d7 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithImplicitType.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/topLevelFunctionsWithImplicitType.txt @@ -42,6 +42,17 @@ FILE: topLevelFunctionsWithImplicitType.kt ^functionWithLazyBody String(42) } +ARGUMENTS_OF_ANNOTATIONS: +FILE: topLevelFunctionsWithImplicitType.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) + } + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { + } + public? final? [RAW_FIR] fun functionWithLazyBody(): { + ^functionWithLazyBody String(42) + } + STATUS: FILE: topLevelFunctionsWithImplicitType.kt public final [STATUS] fun resolveMe(): R|kotlin/Unit| { @@ -143,12 +154,12 @@ FILE: topLevelFunctionsWithImplicitType.kt AnnotationsArguments: FILE: topLevelFunctionsWithImplicitType.kt - public final [BODY_RESOLVE] fun resolveMe(): R|kotlin/Unit| { - R|/receive|(R|/functionWithLazyBody|()) + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun resolveMe(): R|kotlin/Unit| { + receive#(functionWithLazyBody#()) } - public final [STATUS] fun receive([RAW_FIR] value: R|kotlin/String|): R|kotlin/Unit| { + public? final? [RAW_FIR] fun receive([RAW_FIR] value: String): R|kotlin/Unit| { } - public final [IMPLICIT_TYPES_BODY_RESOLVE] fun functionWithLazyBody(): R|kotlin/String| { + public? final? [RAW_FIR] fun functionWithLazyBody(): { ^functionWithLazyBody String(42) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfLocalFunction.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfLocalFunction.txt index 35151d038d8..687240823ad 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfLocalFunction.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfLocalFunction.txt @@ -30,6 +30,14 @@ FILE: typeParameterOfLocalFunction.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: typeParameterOfLocalFunction.kt + public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { + local final [BODY_RESOLVE] fun kkk(): R|kotlin/Unit| { + } + + } + STATUS: FILE: typeParameterOfLocalFunction.kt public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfNonLocalFunction.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfNonLocalFunction.txt index bfe0b0a3cbc..d302256b9c1 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfNonLocalFunction.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfNonLocalFunction.txt @@ -46,6 +46,18 @@ FILE: typeParameterOfNonLocalFunction.kt } +ARGUMENTS_OF_ANNOTATIONS: +FILE: typeParameterOfNonLocalFunction.kt + public? final? [SUPER_TYPES] class X : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=X] constructor(): R|X| { + super() + } + + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun ddd(): R|kotlin/Unit| { + } + + } + STATUS: FILE: typeParameterOfNonLocalFunction.kt public final [SUPER_TYPES] class X : R|kotlin/Any| { @@ -132,12 +144,12 @@ FILE: typeParameterOfNonLocalFunction.kt AnnotationsArguments: FILE: typeParameterOfNonLocalFunction.kt - public final [STATUS] class X : R|kotlin/Any| { - public [STATUS] [ContainingClassKey=X] constructor(): R|X| { + public? final? [SUPER_TYPES] class X : R|kotlin/Any| { + public? [SUPER_TYPES] [ContainingClassKey=X] constructor(): R|X| { super() } - public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun ddd(): R|kotlin/Unit| { } } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopFunction.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopFunction.txt index 956b1616b4a..fe829e085b7 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopFunction.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopFunction.txt @@ -18,6 +18,11 @@ FILE: typeParameterOfTopFunction.kt public? final? [TYPES] fun ddd(): R|kotlin/Unit| { } +ARGUMENTS_OF_ANNOTATIONS: +FILE: typeParameterOfTopFunction.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun ddd(): R|kotlin/Unit| { + } + STATUS: FILE: typeParameterOfTopFunction.kt public final [STATUS] fun ddd(): R|kotlin/Unit| { @@ -55,7 +60,7 @@ FILE: typeParameterOfTopFunction.kt AnnotationsArguments: FILE: typeParameterOfTopFunction.kt - public final [BODY_RESOLVE] fun ddd(): R|kotlin/Unit| { + public? final? [ARGUMENTS_OF_ANNOTATIONS] fun ddd(): R|kotlin/Unit| { } DeclarationStatus: diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopSetter.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopSetter.txt index 938c4a810d3..528b2cc4901 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopSetter.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/typeParameterOfTopSetter.txt @@ -30,6 +30,14 @@ FILE: typeParameterOfTopSetter.kt ^ Unit# } +ARGUMENTS_OF_ANNOTATIONS: +FILE: typeParameterOfTopSetter.kt + public? final? [ARGUMENTS_OF_ANNOTATIONS] var x: R|kotlin/Int| = IntegerLiteral(2) + [TYPES] public? get(): R|kotlin/Int| + [ARGUMENTS_OF_ANNOTATIONS] public? set([RAW_FIR] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { + ^ Unit# + } + STATUS: FILE: typeParameterOfTopSetter.kt public final [STATUS] var x: R|kotlin/Int| = IntegerLiteral(2) @@ -104,10 +112,10 @@ FILE: typeParameterOfTopSetter.kt AnnotationsArguments: FILE: typeParameterOfTopSetter.kt - public final [BODY_RESOLVE] var x: R|kotlin/Int| = Int(2) - [BODY_RESOLVE] public get(): R|kotlin/Int| - [BODY_RESOLVE] public set([BODY_RESOLVE] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { - ^ Q|kotlin/Unit| + public? final? [ARGUMENTS_OF_ANNOTATIONS] var x: R|kotlin/Int| = IntegerLiteral(2) + [TYPES] public? get(): R|kotlin/Int| + [ARGUMENTS_OF_ANNOTATIONS] public? set([RAW_FIR] resolveMe: R|kotlin/Int|): R|kotlin/Unit| { + ^ Unit# } CallableContracts: diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyDeclarationResolveTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyDeclarationResolveTestGenerated.java index 1ba7695ce3d..5a36db7fb17 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyDeclarationResolveTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyDeclarationResolveTestGenerated.java @@ -24,6 +24,12 @@ public class FirLazyDeclarationResolveTestGenerated extends AbstractFirLazyDecla KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationParameters.kt") + public void testAnnotationParameters() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/lazyResolve/annotationParameters.kt"); + } + @Test @TestMetadata("annotations.kt") public void testAnnotations() throws Exception {