From f124ba627dca9f6cab973aa94f9e93e0ef809195 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Thu, 21 Sep 2023 18:07:19 +0200 Subject: [PATCH] [FIR] implicit type: avoid redundant property and function transformations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a contract violation – we can touch only bodies during this phase ^KT-56551 --- .../fir/transformers/LLFirBodyLazyResolver.kt | 14 +- .../inBlockModification/rawContractScript.txt | 8 +- .../compilerRequiredAnnotationsOnProperty.txt | 10 +- ...onsOnPropertyDelegate.out_of_src_roots.txt | 10 +- ...rRequiredAnnotationsOnPropertyDelegate.txt | 10 +- ...redAnnotationsOnPropertyDelegateScript.txt | 10 +- ...lerRequiredAnnotationsOnPropertyScript.txt | 11 +- .../testData/lazyResolve/fakeOverride.txt | 2 +- .../lazyResolve/fakeOverrideScript.txt | 2 +- ...functionWithImplicitTypeAndAnnotations.txt | 70 ++++---- ...onWithImplicitTypeAndAnnotationsScript.txt | 72 ++++---- ...citTypeAndStringTemplateAsDefaultValue.txt | 12 +- ...eAndStringTemplateAsDefaultValueScript.txt | 13 +- ...nctionWithRawContract.out_of_src_roots.txt | 4 +- ...ypeOnFunctionWithUnresolvedRawContract.txt | 4 +- ...nWithWrongRawContract.out_of_src_roots.txt | 4 +- ...propertyWithImplicitTypeAndAnnotations.txt | 60 +++---- ...tyWithImplicitTypeAndAnnotationsScript.txt | 60 +++---- ...rtyWithImplicitTypeAndFieldAnnotations.txt | 38 ++-- ...hImplicitTypeAndFieldAnnotationsScript.txt | 38 ++-- .../testData/lazyResolve/script.txt | 2 +- .../fir/plugin/PropertyBuildingContext.kt | 2 +- .../FirDeclarationsResolveTransformer.kt | 164 ++++++++++++------ ...irAnnotationArgumentsMappingTransformer.kt | 4 - .../FirPropertyBodyResolveState.kt | 2 +- .../synthetic/FirSyntheticProperty.kt | 2 +- ...yRecursivelyAnnotatedGlobalFunction.fir.kt | 4 - ...uallyRecursivelyAnnotatedGlobalFunction.kt | 1 + ...rsivelyAnnotatedGlobalFunction.reversed.kt | 4 - .../RecursivelyAnnotatedGlobalFunction.fir.kt | 3 - .../RecursivelyAnnotatedGlobalFunction.kt | 1 + .../cycleAnnotationOnFunction.fir.kt | 6 - .../annotations/cycleAnnotationOnFunction.kt | 1 + .../cycleAnnotationOnFunctionParameterType.kt | 2 +- .../cycleAnnotationOnProperty.fir.kt | 10 -- .../annotations/cycleAnnotationOnProperty.kt | 1 + ...notationOnReceiverParameterFunction.fir.kt | 5 - ...leAnnotationOnReceiverParameterFunction.kt | 1 + ...notationOnReceiverParameterProperty.fir.kt | 5 - ...leAnnotationOnReceiverParameterProperty.kt | 1 + .../cycleAnnotationOnTypeParameterFunction.kt | 2 +- .../cycleAnnotationOnTypeParameterProperty.kt | 2 +- 42 files changed, 359 insertions(+), 318 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.reversed.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.fir.kt diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/transformers/LLFirBodyLazyResolver.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/transformers/LLFirBodyLazyResolver.kt index ef43c7d8a86..d52ae744b33 100644 --- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/transformers/LLFirBodyLazyResolver.kt +++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/transformers/LLFirBodyLazyResolver.kt @@ -323,6 +323,10 @@ internal object BodyStateKeepers { val FUNCTION: StateKeeper = stateKeeper { function, designation -> if (function.isCertainlyResolved) { + if (!isCallableWithSpecialBody(function)) { + entityList(function.valueParameters, VALUE_PARAMETER, designation) + } + return@stateKeeper } @@ -366,7 +370,7 @@ internal object BodyStateKeepers { } val PROPERTY: StateKeeper = stateKeeper { property, designation -> - if (property.bodyResolveState >= FirPropertyBodyResolveState.EVERYTHING_RESOLVED) { + if (property.bodyResolveState >= FirPropertyBodyResolveState.ALL_BODIES_RESOLVED) { return@stateKeeper } @@ -431,14 +435,14 @@ private val FirScript.isCertainlyResolved: Boolean val dependentProperty = findResultProperty() ?: return false // This meant that we already resolve the entire script on implicit body phase - return dependentProperty.bodyResolveState == FirPropertyBodyResolveState.EVERYTHING_RESOLVED + return dependentProperty.bodyResolveState == FirPropertyBodyResolveState.ALL_BODIES_RESOLVED } private val FirFunction.isCertainlyResolved: Boolean get() { if (this is FirPropertyAccessor) { val requiredState = when { - isSetter -> FirPropertyBodyResolveState.EVERYTHING_RESOLVED + isSetter -> FirPropertyBodyResolveState.ALL_BODIES_RESOLVED else -> FirPropertyBodyResolveState.INITIALIZER_AND_GETTER_RESOLVED } @@ -459,7 +463,7 @@ private val FirVariable.initializerIfUnresolved: FirExpression? private val FirVariable.delegateIfUnresolved: FirExpression? get() = when (this) { - is FirProperty -> if (bodyResolveState < FirPropertyBodyResolveState.EVERYTHING_RESOLVED) delegate else null + is FirProperty -> if (bodyResolveState < FirPropertyBodyResolveState.ALL_BODIES_RESOLVED) delegate else null else -> delegate } @@ -470,7 +474,7 @@ private val FirProperty.getterIfUnresolved: FirPropertyAccessor? get() = if (bodyResolveState < FirPropertyBodyResolveState.INITIALIZER_AND_GETTER_RESOLVED) getter else null private val FirProperty.setterIfUnresolved: FirPropertyAccessor? - get() = if (bodyResolveState < FirPropertyBodyResolveState.EVERYTHING_RESOLVED) setter else null + get() = if (bodyResolveState < FirPropertyBodyResolveState.ALL_BODIES_RESOLVED) setter else null private fun delegatedConstructorCallGuard(fir: FirDelegatedConstructorCall): FirDelegatedConstructorCall { if (fir is FirLazyDelegatedConstructorCall) { diff --git a/analysis/low-level-api-fir/testData/inBlockModification/rawContractScript.txt b/analysis/low-level-api-fir/testData/inBlockModification/rawContractScript.txt index 9f11904e6f3..84fe9f44498 100644 --- a/analysis/low-level-api-fir/testData/inBlockModification/rawContractScript.txt +++ b/analysis/low-level-api-fir/testData/inBlockModification/rawContractScript.txt @@ -1,5 +1,11 @@ BEFORE MODIFICATION: -public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] arg: R|kotlin/Any?|, [ResolvedTo(BODY_RESOLVE)] num: R|kotlin/Int?|, [ResolvedTo(BODY_RESOLVE)] block: R|() -> kotlin/Unit|): R|kotlin/Unit| { +public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] arg: R|kotlin/Any?|, [ResolvedTo(BODY_RESOLVE)] num: R|kotlin/Int?|, [ResolvedTo(BODY_RESOLVE)] block: R|() -> kotlin/Unit|): R|kotlin/Unit| + [Contract description] < + #().#((R|/arg| is R|kotlin/String|)), + #().#(!=(R|/num|, Null(null))), + #(R|/block|, #.#) + > + { #((R|/arg| is R|kotlin/String|)) #(!=(R|/num|, Null(null))) R|/block|.R|SubstitutionOverride|() diff --git a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnProperty.txt b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnProperty.txt index faea35bad29..a12684291d3 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnProperty.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnProperty.txt @@ -154,16 +154,16 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnProperty.kt - public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| { + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String } - @R|kotlin/Deprecated|[Types](message = String(property)) @R|Anno|[Types](s = String(property)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var memberProperty: R|kotlin/Int| = Int(32) + @R|kotlin/Deprecated|[Types](String(property)) @R|Anno|[Types](String(property)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var memberProperty: R|kotlin/Int| = Int(32) @R|kotlin/Deprecated|[Types](String(getter)) @R|Anno|[Types](String(getter)) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| { ^ field# } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.out_of_src_roots.txt b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.out_of_src_roots.txt index 7b579ca0935..f9a75687265 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.out_of_src_roots.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.out_of_src_roots.txt @@ -160,16 +160,16 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyDelegate.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyDelegate.kt - public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| { + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String } - field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](message = String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: by #( = [ResolvedTo(RAW_FIR)] lazy@fun (): R|kotlin/String| { + field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: by #( = [ResolvedTo(RAW_FIR)] lazy@fun (): R|kotlin/String| { ^ String(42) } ) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.txt b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.txt index 1ec1e68f848..5a67b36f2e6 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegate.txt @@ -160,16 +160,16 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyDelegate.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyDelegate.kt - public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| { + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String } - field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](message = String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: R|kotlin/String|by R|kotlin/lazy|( = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0] lazy@fun (): R|kotlin/String| { + field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: R|kotlin/String|by R|kotlin/lazy|( = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0] lazy@fun (): R|kotlin/String| { ^ String(42) } ) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegateScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegateScript.txt index ba082c57ee2..9aaa4446139 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegateScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyDelegateScript.txt @@ -224,17 +224,17 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyDelegateScript. SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| { + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String } - field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](message = String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](s = String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: R|kotlin/String|by R|kotlin/lazy|( = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0] lazy@fun (): R|kotlin/String| { + field:@PROPERTY_DELEGATE_FIELD:R|kotlin/Deprecated|[Types](String(delegate)) @PROPERTY_DELEGATE_FIELD:R|Anno|[Types](String(delegate)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val memberProperty: R|kotlin/String|by R|kotlin/lazy|( = [ResolvedTo(RAW_FIR)] [MatchingParameterFunctionTypeKey=kotlin/Function0] lazy@fun (): R|kotlin/String| { ^ String(42) } ) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyScript.txt index 39248c6b9ca..c1554f7139b 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/compilerRequiredAnnotationsOnPropertyScript.txt @@ -218,17 +218,17 @@ FILE: [ResolvedTo(IMPORTS)] compilerRequiredAnnotationsOnPropertyScript.kts SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.s] s: R|kotlin/String|): R|Anno| { + public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.s] s: String): R|Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String } - @R|kotlin/Deprecated|[Types](message = String(property)) @R|Anno|[Types](s = String(property)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var memberProperty: R|kotlin/Int| = Int(32) + @R|kotlin/Deprecated|[Types](String(property)) @R|Anno|[Types](String(property)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var memberProperty: R|kotlin/Int| = Int(32) @R|kotlin/Deprecated|[Types](String(getter)) @R|Anno|[Types](String(getter)) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| { ^ field# } @@ -310,3 +310,4 @@ FILE: [ResolvedTo(BODY_RESOLVE)] compilerRequiredAnnotationsOnPropertyScript.kts @PROPERTY_SETTER:R|kotlin/Deprecated|[Types](message = String(setter)) @R|Anno|[Types](s = String(setter)) @SETTER_PARAMETER:R|kotlin/Deprecated|[Types](message = String(setparam)) @SETTER_PARAMETER:R|Anno|[Types](s = String(setparam)) public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| { F|/memberProperty| = R|/value| } + diff --git a/analysis/low-level-api-fir/testData/lazyResolve/fakeOverride.txt b/analysis/low-level-api-fir/testData/lazyResolve/fakeOverride.txt index 2ed9c70de6f..a85a0fd966c 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/fakeOverride.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/fakeOverride.txt @@ -501,7 +501,7 @@ FILE: [ResolvedTo(IMPORTS)] fakeOverride.kt public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val asString: R|kotlin/String| = R|/asString| public [ResolvedTo(STATUS)] [ContainingClassKey=Kind] get(): R|kotlin/String| - @R|kotlin/Suppress|[Types](names = vararg(String(UNCHECKED_CAST))) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun valueOf([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] aConst: R|IrConst<*>|): R|T| { + @R|kotlin/Suppress|[Types](String(UNCHECKED_CAST)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun valueOf([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] aConst: R|IrConst<*>|): R|T| { ^valueOf (R|/aConst| as R|IrConst|).R|SubstitutionOverride| } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/fakeOverrideScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/fakeOverrideScript.txt index a4b2d4d8d2b..5a3969dc52d 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/fakeOverrideScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/fakeOverrideScript.txt @@ -590,7 +590,7 @@ FILE: [ResolvedTo(IMPORTS)] fakeOverrideScript.kts public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val asString: R|kotlin/String| = R|/asString| public [ResolvedTo(STATUS)] [ContainingClassKey=Kind] get(): R|kotlin/String| - @R|kotlin/Suppress|[Types](names = vararg(String(UNCHECKED_CAST))) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun valueOf([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] aConst: R|IrConst<*>|): R|T| { + @R|kotlin/Suppress|[Types](String(UNCHECKED_CAST)) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun valueOf([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] aConst: R|IrConst<*>|): R|T| { ^valueOf (R|/aConst| as R|IrConst|).R|SubstitutionOverride| } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt index 302b1f00b0d..c19f646aa93 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotations.txt @@ -270,30 +270,30 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val functionProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val parameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val defaultValueProperty: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] 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(IMPLICIT_TYPES_BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) kotlin/Int|.function([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](parameterProperty#) param: R|@R|myPack/Anno|(valueParameterTypeProperty#) kotlin/Int| = defaultValueProperty#): R|kotlin/String| { ^function String(str) } @@ -308,21 +308,21 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](functionProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](parameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) + @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val defaultValueProperty: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](valueParameterTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { + @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = defaultValueProperty#): R|kotlin/String| { ^function String(str) } @@ -337,19 +337,19 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](functionProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](parameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](defaultValueProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](valueParameterTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(BODY_RESOLVE)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { ^function String(str) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt index 9eb2e9758d7..dc7623425b9 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndAnnotationsScript.txt @@ -404,38 +404,38 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotationsScript.kts SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val functionProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val parameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val defaultValueProperty: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val valueParameterTypeProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { + @R|myPack/Anno|[Types](functionProperty#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) kotlin/Int|.function([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](parameterProperty#) param: R|@R|myPack/Anno|(valueParameterTypeProperty#) kotlin/Int| = defaultValueProperty#): R|kotlin/String| { ^function String(str) } @@ -456,28 +456,28 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotationsScript.kts } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](functionProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](parameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) + @Anno[Unresolved](LAZY_EXPRESSION) public? final? const [ResolvedTo(RAW_FIR)] val defaultValueProperty: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](valueParameterTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { + @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = defaultValueProperty#): R|kotlin/String| { ^function String(str) } @@ -498,25 +498,25 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndAnnotationsScript.kts } - @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](functionProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val functionProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](parameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val parameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/defaultValueProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](defaultValueProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val defaultValueProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/valueParameterTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](valueParameterTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val valueParameterTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/functionProperty|) public final [ResolvedTo(BODY_RESOLVE)] fun <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) kotlin/Int|.function([ResolvedTo(BODY_RESOLVE)] @R|myPack/Anno|[Types](number = R|myPack/parameterProperty|) param: R|@R|myPack/Anno|(number = R|myPack/valueParameterTypeProperty|) kotlin/Int| = R|myPack/defaultValueProperty|): R|kotlin/String| { diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValue.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValue.txt index c9c1158a6b6..be9d12e515a 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValue.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValue.txt @@ -60,17 +60,17 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndStringTemplateAsDefaultVa IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndStringTemplateAsDefaultValue.kt - public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val myNumber: R|kotlin/Int| = Int(1) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun topLevelFunction([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] firstParam: R|kotlin/Int|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] secondParam: R|kotlin/String| = (String(My str ), R|/firstParam|.R|kotlin/Int.plus|(R|myPack/myNumber|).R|kotlin/Int.toString|())): R|kotlin/Int| { + public? final? const [ResolvedTo(RAW_FIR)] val myNumber: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun topLevelFunction([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] firstParam: R|kotlin/Int|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] secondParam: R|kotlin/String| = (String(My str ), firstParam#.plus#(myNumber#).toString#())): R|kotlin/Int| { ^topLevelFunction Int(42) } ANNOTATIONS_ARGUMENTS_MAPPING: FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndStringTemplateAsDefaultValue.kt - public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val myNumber: R|kotlin/Int| = Int(1) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun topLevelFunction([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] firstParam: R|kotlin/Int|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] secondParam: R|kotlin/String| = (String(My str ), R|/firstParam|.R|kotlin/Int.plus|(R|myPack/myNumber|).R|kotlin/Int.toString|())): R|kotlin/Int| { + public? final? const [ResolvedTo(RAW_FIR)] val myNumber: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun topLevelFunction([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] firstParam: R|kotlin/Int|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] secondParam: R|kotlin/String| = (String(My str ), firstParam#.plus#(myNumber#).toString#())): R|kotlin/Int| { ^topLevelFunction Int(42) } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValueScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValueScript.txt index 7c4f8a05a73..8b62b70a469 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValueScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithImplicitTypeAndStringTemplateAsDefaultValueScript.txt @@ -124,10 +124,10 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndStringTemplateAsDefaultVa SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val myNumber: R|kotlin/Int| = Int(1) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public? final? const [ResolvedTo(RAW_FIR)] val myNumber: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): - public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun topLevelFunction([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] firstParam: R|kotlin/Int|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] secondParam: R|kotlin/String| = (String(My str ), R|/firstParam|.R|kotlin/Int.plus|(R|myPack/myNumber|).R|kotlin/Int.toString|())): R|kotlin/Int| { + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun topLevelFunction([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] firstParam: R|kotlin/Int|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] secondParam: R|kotlin/String| = (String(My str ), firstParam#.plus#(myNumber#).toString#())): R|kotlin/Int| { ^topLevelFunction Int(42) } @@ -138,10 +138,10 @@ FILE: [ResolvedTo(IMPORTS)] functionWithImplicitTypeAndStringTemplateAsDefaultVa SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val myNumber: R|kotlin/Int| = Int(1) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public? final? const [ResolvedTo(RAW_FIR)] val myNumber: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): - public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun topLevelFunction([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] firstParam: R|kotlin/Int|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] secondParam: R|kotlin/String| = (String(My str ), R|/firstParam|.R|kotlin/Int.plus|(R|myPack/myNumber|).R|kotlin/Int.toString|())): R|kotlin/Int| { + public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun topLevelFunction([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] firstParam: R|kotlin/Int|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] secondParam: R|kotlin/String| = (String(My str ), firstParam#.plus#(myNumber#).toString#())): R|kotlin/Int| { ^topLevelFunction Int(42) } @@ -172,3 +172,4 @@ FILE: [ResolvedTo(BODY_RESOLVE)] functionWithImplicitTypeAndStringTemplateAsDefa public final [ResolvedTo(BODY_RESOLVE)] fun topLevelFunction([ResolvedTo(BODY_RESOLVE)] firstParam: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] secondParam: R|kotlin/String| = (String(My str ), R|/firstParam|.R|kotlin/Int.plus|(R|myPack/myNumber|).R|kotlin/Int.toString|())): R|kotlin/Int| { ^topLevelFunction Int(42) } + diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt index c2a4e4a2f68..209594869d0 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithRawContract.out_of_src_roots.txt @@ -80,7 +80,7 @@ IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - #().#(R|/bool|) + returns#().implies#(bool#) > { ^foo R|/bool| @@ -90,7 +90,7 @@ ANNOTATIONS_ARGUMENTS_MAPPING: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithRawContract.kt public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - #().#(R|/bool|) + returns#().implies#(bool#) > { ^foo R|/bool| diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt index 684576e056c..8217e0e67fe 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithUnresolvedRawContract.txt @@ -80,7 +80,7 @@ IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - #().#(R|/bool|) + returns#().implies#(bool#) > { ^foo R|/bool| @@ -90,7 +90,7 @@ ANNOTATIONS_ARGUMENTS_MAPPING: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithUnresolvedRawContract.kt public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - #().#(R|/bool|) + returns#().implies#(bool#) > { ^foo R|/bool| diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt index b885c703ebb..b6a1babd0cb 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.out_of_src_roots.txt @@ -80,7 +80,7 @@ IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - # + abc# > { ^foo R|/bool| @@ -90,7 +90,7 @@ ANNOTATIONS_ARGUMENTS_MAPPING: FILE: [ResolvedTo(IMPORTS)] implicitTypeOnFunctionWithWrongRawContract.kt public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] fun foo([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] bool: R|kotlin/Boolean|): R|kotlin/Boolean| [Contract description] < - # + abc# > { ^foo R|/bool| diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotations.txt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotations.txt index 1cb1640a1aa..3f1c41e79ac 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotations.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotations.txt @@ -294,31 +294,31 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotations.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotations.kt - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val propertyProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val getterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterParameterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](propertyProperty#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) T|.variableToResolve: R|kotlin/String| + @R|myPack/Anno|[Types](getterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { ^ String(str) } @R|myPack/Anno|[Types](setterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](setterParameterProperty#) value: R|kotlin/String|): R|kotlin/Unit| { @@ -336,19 +336,19 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] get(): R|kotlin/String| { @@ -369,19 +369,19 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(BODY_RESOLVE)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| { diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotationsScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotationsScript.txt index 0821a596bb2..ce9bfed4bf9 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotationsScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndAnnotationsScript.txt @@ -428,21 +428,21 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotationsScript.kts SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FUNCTION|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val propertyProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val getterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @@ -450,17 +450,17 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotationsScript.kts @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterParameterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val receiverTypeProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val typeParameterProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { + @R|myPack/Anno|[Types](propertyProperty#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var <@R|myPack/Anno|[Types](typeParameterProperty#) [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](receiverProperty#) R|@R|myPack/Anno|(receiverTypeProperty#) T|.variableToResolve: R|kotlin/String| + @R|myPack/Anno|[Types](getterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { ^ String(str) } @R|myPack/Anno|[Types](setterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] @R|myPack/Anno|[Types](setterParameterProperty#) value: R|kotlin/String|): R|kotlin/Unit| { @@ -484,25 +484,25 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotationsScript.kts } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| @@ -530,25 +530,25 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndAnnotationsScript.kts } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/receiverTypeProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](receiverTypeProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val receiverTypeProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](typeParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val typeParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final [ResolvedTo(BODY_RESOLVE)] var <@R|myPack/Anno|[Types](number = R|myPack/typeParameterProperty|) [ResolvedTo(BODY_RESOLVE)] T> @RECEIVER:R|myPack/Anno|[Types](number = R|myPack/receiverProperty|) R|@R|myPack/Anno|(number = R|myPack/receiverTypeProperty|) T|.variableToResolve: R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotations.txt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotations.txt index e8138d24b80..09523e2b3e6 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotations.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotations.txt @@ -254,26 +254,26 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotations.kt IMPLICIT_TYPES_BODY_RESOLVE: FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotations.kt - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FIELD|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FIELD|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val propertyProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val getterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterParameterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableToResolve: R|kotlin/String| = (Int(42)) + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val fieldProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): + @R|myPack/Anno|[Types](propertyProperty#) field:@FIELD:R|myPack/Anno|[Types](fieldProperty#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableToResolve: R|kotlin/String| = (Int(42)) @R|myPack/Anno|[Types](getterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { ^ field#.plus#(String(str)) } @@ -292,15 +292,15 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](fieldProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var variableToResolve: R|kotlin/String| = (Int(42)) @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] get(): R|kotlin/String| { @@ -321,15 +321,15 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotations.kt public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](fieldProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(BODY_RESOLVE)] [IsReferredViaField=true] var variableToResolve: R|kotlin/String| = (Int(42)) @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| { diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotationsScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotationsScript.txt index f7035d0f6c7..be87f1402a9 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotationsScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithImplicitTypeAndFieldAnnotationsScript.txt @@ -368,18 +368,18 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotationsScript.kt SCRIPT: [ResolvedTo(TYPES)] [ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array| - @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FIELD|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=myPack/Anno.number] number: R|kotlin/Int|): R|myPack/Anno| { + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.FIELD|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=myPack/Anno.number] number: Int): R|myPack/Anno| { LAZY_super } - public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| - public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val propertyProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val getterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): @@ -390,10 +390,10 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotationsScript.kt @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val setterParameterProperty: = LAZY_EXPRESSION public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) - public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + @R|myPack/Anno|[Types](LAZY_EXPRESSION) public final const [ResolvedTo(STATUS)] val fieldProperty: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] get(): - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableToResolve: R|kotlin/String| = (Int(42)) + @R|myPack/Anno|[Types](propertyProperty#) field:@FIELD:R|myPack/Anno|[Types](fieldProperty#) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableToResolve: R|kotlin/String| = (Int(42)) @R|myPack/Anno|[Types](getterProperty#) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { ^ field#.plus#(String(str)) } @@ -418,19 +418,19 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotationsScript.kt } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](fieldProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] var variableToResolve: R|kotlin/String| = (Int(42)) @@ -458,19 +458,19 @@ FILE: [ResolvedTo(IMPORTS)] propertyWithImplicitTypeAndFieldAnnotationsScript.kt } - @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](propertyProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/getterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](getterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val getterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/setterParameterProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](setterParameterProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val setterParameterProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| - @R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) + @R|myPack/Anno|[Types](fieldProperty#) public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val fieldProperty: R|kotlin/Int| = Int(42) public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| @R|myPack/Anno|[Types](number = R|myPack/propertyProperty|) field:@FIELD:R|myPack/Anno|[Types](number = R|myPack/fieldProperty|) public final [ResolvedTo(BODY_RESOLVE)] [IsReferredViaField=true] var variableToResolve: R|kotlin/String| = (Int(42)) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/script.txt b/analysis/low-level-api-fir/testData/lazyResolve/script.txt index 20e8109c5f9..927e7071b5b 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/script.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/script.txt @@ -706,7 +706,7 @@ FILE: [ResolvedTo(IMPORTS)] script.kts } - @R|Anno|[Types](s = Q|En|.R|/En.Entry|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun build([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] action: R|Builder.() -> kotlin/Unit|): R|Builder| { + @R|Anno|[Types](Q|En|.R|/En.Entry|) public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun build([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] action: R|Builder.() -> kotlin/Unit|): R|Builder| { ^build R|/Builder.Builder|().R|kotlin/apply|(R|/action|) } diff --git a/compiler/fir/plugin-utils/src/org/jetbrains/kotlin/fir/plugin/PropertyBuildingContext.kt b/compiler/fir/plugin-utils/src/org/jetbrains/kotlin/fir/plugin/PropertyBuildingContext.kt index b4c4903d588..82e43dc015a 100644 --- a/compiler/fir/plugin-utils/src/org/jetbrains/kotlin/fir/plugin/PropertyBuildingContext.kt +++ b/compiler/fir/plugin-utils/src/org/jetbrains/kotlin/fir/plugin/PropertyBuildingContext.kt @@ -121,7 +121,7 @@ public class PropertyBuildingContext( ) } isLocal = false - bodyResolveState = FirPropertyBodyResolveState.EVERYTHING_RESOLVED + bodyResolveState = FirPropertyBodyResolveState.ALL_BODIES_RESOLVED } } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 6446274704e..600c1d68452 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -46,12 +46,14 @@ import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImplWithoutSource +import org.jetbrains.kotlin.fir.utils.exceptions.withFirEntry import org.jetbrains.kotlin.fir.visitors.FirTransformer import org.jetbrains.kotlin.fir.visitors.transformSingle import org.jetbrains.kotlin.resolve.calls.inference.buildCurrentSubstitutor import org.jetbrains.kotlin.resolve.calls.inference.components.TypeVariableDirectionCalculator import org.jetbrains.kotlin.resolve.calls.inference.model.ProvideDelegateFixationPosition import org.jetbrains.kotlin.types.model.TypeConstructorMarker +import org.jetbrains.kotlin.utils.exceptions.requireWithAttachment open class FirDeclarationsResolveTransformer( transformer: FirAbstractBodyResolveTransformerDispatcher @@ -124,22 +126,25 @@ open class FirDeclarationsResolveTransformer( } val returnTypeRefBeforeResolve = property.returnTypeRef - val bodyResolveState = property.bodyResolveState - if (bodyResolveState == FirPropertyBodyResolveState.EVERYTHING_RESOLVED) return property - val cannotHaveDeepImplicitTypeRefs = property.backingField?.returnTypeRef !is FirImplicitTypeRef if (implicitTypeOnly && returnTypeRefBeforeResolve !is FirImplicitTypeRef && cannotHaveDeepImplicitTypeRefs) { return property } - property.transformReceiverParameter(transformer, ResolutionMode.ContextIndependent) - doTransformTypeParameters(property) val shouldResolveEverything = !implicitTypeOnly + // this is required to resolve annotations on properties of local classes + if (shouldResolveEverything) { + property.transformReceiverParameter(transformer, ResolutionMode.ContextIndependent) + doTransformTypeParameters(property) + } + + val bodyResolveState = property.bodyResolveState return withFullBodyResolve { val initializerIsAlreadyResolved = bodyResolveState >= FirPropertyBodyResolveState.INITIALIZER_RESOLVED if (!initializerIsAlreadyResolved) { dataFlowAnalyzer.enterProperty(property) } + var backingFieldIsAlreadyResolved = false context.withProperty(property) { context.forPropertyInitializer { @@ -147,30 +152,47 @@ open class FirDeclarationsResolveTransformer( val resolutionMode = withExpectedType(returnTypeRefBeforeResolve) property.transformReturnTypeRef(transformer, resolutionMode) .transformInitializer(transformer, resolutionMode) - .transformTypeParameters(transformer, resolutionMode) .replaceBodyResolveState(FirPropertyBodyResolveState.INITIALIZER_RESOLVED) } - // Return type needs to be resolved before resolving annotations (transformOtherChildren) because of a possible cycle - // @Ann(myConst) const val myConst = "" + if (property.initializer != null) { storeVariableReturnType(property) } - if (!initializerIsAlreadyResolved) { - property.transformOtherChildren(transformer, data) - } + val canResolveBackingFieldEarly = property.hasExplicitBackingField || property.returnTypeRef is FirResolvedTypeRef if (!initializerIsAlreadyResolved && canResolveBackingFieldEarly) { - property.transformBackingField(transformer, withExpectedType(property.returnTypeRef)) + property.backingField?.let { + transformBackingField(it, withExpectedType(property.returnTypeRef), shouldResolveEverything) + } + backingFieldIsAlreadyResolved = true } } + + // this is required to resolve annotations on properties of local classes + if (shouldResolveEverything) { + property.transformAnnotations(transformer, data) + if (initializerIsAlreadyResolved) { + property.backingField?.transformAnnotations(transformer, data) + } + } + val delegate = property.delegate if (delegate != null) { - transformPropertyAccessorsWithDelegate(property, delegate) - if (property.delegateFieldSymbol != null) { - replacePropertyReferenceTypeInDelegateAccessors(property) + if (bodyResolveState == FirPropertyBodyResolveState.ALL_BODIES_RESOLVED) { + requireWithAttachment(shouldResolveEverything, { "Invariant is broken" }) { + withFirEntry("property", property) + } + + property.transformAccessors(SetterResolutionMode.FULLY_RESOLVE, shouldResolveEverything = true) + } else { + transformPropertyAccessorsWithDelegate(property, delegate) + if (property.delegateFieldSymbol != null) { + replacePropertyReferenceTypeInDelegateAccessors(property) + } + + property.replaceBodyResolveState(FirPropertyBodyResolveState.ALL_BODIES_RESOLVED) } - property.replaceBodyResolveState(FirPropertyBodyResolveState.EVERYTHING_RESOLVED) } else { val hasDefaultAccessors = (property.getter == null || property.getter is FirDefaultPropertyAccessor) && @@ -181,10 +203,11 @@ open class FirDeclarationsResolveTransformer( val mayResolveGetter = mayResolveSetter || !propertyTypeIsKnown if (mayResolveGetter) { property.transformAccessors( - if (mayResolveSetter) SetterResolutionMode.FULLY_RESOLVE else SetterResolutionMode.ONLY_IMPLICIT_PARAMETER_TYPE + if (mayResolveSetter) SetterResolutionMode.FULLY_RESOLVE else SetterResolutionMode.ONLY_IMPLICIT_PARAMETER_TYPE, + shouldResolveEverything, ) property.replaceBodyResolveState( - if (mayResolveSetter) FirPropertyBodyResolveState.EVERYTHING_RESOLVED + if (mayResolveSetter) FirPropertyBodyResolveState.ALL_BODIES_RESOLVED else FirPropertyBodyResolveState.INITIALIZER_AND_GETTER_RESOLVED ) } else { @@ -196,10 +219,14 @@ open class FirDeclarationsResolveTransformer( } } } + if (!initializerIsAlreadyResolved) { if (!backingFieldIsAlreadyResolved) { - property.transformBackingField(transformer, withExpectedType(property.returnTypeRef)) + property.backingField?.let { + transformBackingField(it, withExpectedType(property.returnTypeRef), shouldResolveEverything) + } } + dataFlowAnalyzer.exitProperty(property)?.let { property.replaceControlFlowGraphReference(FirControlFlowGraphReferenceImpl(it)) } @@ -319,7 +346,7 @@ open class FirDeclarationsResolveTransformer( // `isImplicitTypedProperty` means we haven't run setter resolution yet (see its second usage) if (isImplicitTypedProperty) { - property.resolveSetter(mayResolveSetterBody = true) + property.resolveSetter(mayResolveSetterBody = true, shouldResolveEverything = true) } dataFlowAnalyzer.exitDelegateExpression(delegate) @@ -501,13 +528,11 @@ open class FirDeclarationsResolveTransformer( } private fun FirProperty.transformAccessors( - setterResolutionMode: SetterResolutionMode = SetterResolutionMode.FULLY_RESOLVE + setterResolutionMode: SetterResolutionMode = SetterResolutionMode.FULLY_RESOLVE, + shouldResolveEverything: Boolean = true, ) { - if (bodyResolveState < FirPropertyBodyResolveState.INITIALIZER_AND_GETTER_RESOLVED) { - getter?.let { - transformAccessor(it, this) - } - } + getter?.let { transformAccessor(it, this, shouldResolveEverything) } + if (returnTypeRef is FirImplicitTypeRef) { storeVariableReturnType(this) // Here, we expect `this.returnTypeRef` is updated from the getter's return type // We need update type of getter for case when its type was approximated @@ -515,7 +540,7 @@ open class FirDeclarationsResolveTransformer( } if (setterResolutionMode != SetterResolutionMode.SKIP) { - resolveSetter(mayResolveSetterBody = setterResolutionMode == SetterResolutionMode.FULLY_RESOLVE) + resolveSetter(mayResolveSetterBody = setterResolutionMode == SetterResolutionMode.FULLY_RESOLVE, shouldResolveEverything) } } @@ -528,12 +553,13 @@ open class FirDeclarationsResolveTransformer( private fun FirProperty.resolveSetter( mayResolveSetterBody: Boolean, + shouldResolveEverything: Boolean, ) { setter?.let { it.transformTypeWithPropertyType(returnTypeRef) if (mayResolveSetterBody) { - transformAccessor(it, this) + transformAccessor(it, this, shouldResolveEverything) } } } @@ -559,7 +585,8 @@ open class FirDeclarationsResolveTransformer( private fun transformAccessor( accessor: FirPropertyAccessor, - owner: FirProperty + owner: FirProperty, + shouldResolveEverything: Boolean, ): Unit = whileAnalysing(session, accessor) { context.withPropertyAccessor(owner, accessor, components) { val propertyTypeRef = owner.returnTypeRef @@ -571,9 +598,9 @@ open class FirDeclarationsResolveTransformer( } if (accessor is FirDefaultPropertyAccessor || accessor.body == null) { - transformFunction(accessor, ResolutionMode.ContextIndependent) + transformFunction(accessor, ResolutionMode.ContextIndependent, shouldResolveEverything) } else { - transformFunctionWithGivenSignature(accessor) + transformFunctionWithGivenSignature(accessor, shouldResolveEverything) } } } @@ -726,9 +753,7 @@ open class FirDeclarationsResolveTransformer( simpleFunction: FirSimpleFunction, data: ResolutionMode ): FirSimpleFunction = whileAnalysing(session, simpleFunction) { - if (simpleFunction.bodyResolved) { - return simpleFunction - } + val shouldResolveEverything = !implicitTypeOnly val returnTypeRef = simpleFunction.returnTypeRef if ((returnTypeRef !is FirImplicitTypeRef) && implicitTypeOnly) { return simpleFunction @@ -736,9 +761,13 @@ open class FirDeclarationsResolveTransformer( val containingDeclaration = context.containerIfAny return context.withSimpleFunction(simpleFunction, session) { - doTransformTypeParameters(simpleFunction) + // this is required to resolve annotations on functions of local classes + if (shouldResolveEverything) { + simpleFunction.transformReceiverParameter(this, data) + doTransformTypeParameters(simpleFunction) + } - if (containingDeclaration != null && containingDeclaration !is FirClass) { + if (containingDeclaration != null && containingDeclaration !is FirClass && (containingDeclaration !is FirScript || simpleFunction.isLocal)) { // For class members everything should be already prepared prepareSignatureForBodyResolve(simpleFunction) simpleFunction.transformStatus(this, simpleFunction.resolveStatus().mode()) @@ -747,17 +776,18 @@ open class FirDeclarationsResolveTransformer( simpleFunction.runContractResolveForFunction(session, scopeSession, context) } } + context.forFunctionBody(simpleFunction, components) { withFullBodyResolve { - transformFunctionWithGivenSignature(simpleFunction) + transformFunctionWithGivenSignature(simpleFunction, shouldResolveEverything = shouldResolveEverything) } } } } - private fun transformFunctionWithGivenSignature(function: F): F { + private fun transformFunctionWithGivenSignature(function: F, shouldResolveEverything: Boolean): F { @Suppress("UNCHECKED_CAST") - val result = transformFunction(function, ResolutionMode.ContextIndependent) as F + val result = transformFunction(function, ResolutionMode.ContextIndependent, shouldResolveEverything) as F val body = result.body if (result.returnTypeRef is FirImplicitTypeRef) { @@ -785,14 +815,41 @@ open class FirDeclarationsResolveTransformer( override fun transformFunction( function: FirFunction, data: ResolutionMode - ): FirFunction = whileAnalysing(session, function) { + ): FirFunction { if (function.bodyResolved) return function + + return transformFunction(function, data, shouldResolveEverything = true) + } + + private fun transformFunction( + function: FirFunction, + data: ResolutionMode, + shouldResolveEverything: Boolean, + ): FirFunction = whileAnalysing(session, function) { + val bodyResolved = function.bodyResolved dataFlowAnalyzer.enterFunction(function) - return transformDeclarationContent(function, data).also { - val result = it as FirFunction - val controlFlowGraphReference = dataFlowAnalyzer.exitFunction(result) - result.replaceControlFlowGraphReference(controlFlowGraphReference) - } as FirFunction + + transformer.firResolveContextCollector?.addDeclarationContext(function, context) + if (shouldResolveEverything) { + // Annotations here are required only in the case of a local class member function. + // Separate annotation transformers are responsible in the case of non-local functions. + function.transformReturnTypeRef(this, data).transformValueParameters(this, data).transformAnnotations(this, data) + } + + if (!bodyResolved) { + function.transformBody(this, data) + } + + if (shouldResolveEverything && function is FirContractDescriptionOwner) { + function.transformContractDescription(this, data) + } + + val controlFlowGraphReference = dataFlowAnalyzer.exitFunction(function) + if (!bodyResolved) { + function.replaceControlFlowGraphReference(controlFlowGraphReference) + } + + return function } override fun transformConstructor(constructor: FirConstructor, data: ResolutionMode): FirConstructor = @@ -801,7 +858,6 @@ open class FirDeclarationsResolveTransformer( val container = context.containerIfAny as? FirRegularClass if (constructor.isPrimary && container?.classKind == ClassKind.ANNOTATION_CLASS) { return withFirArrayOfCallTransformer { - doTransformConstructor(constructor, data) } } @@ -1081,6 +1137,12 @@ open class FirDeclarationsResolveTransformer( override fun transformBackingField( backingField: FirBackingField, data: ResolutionMode, + ): FirBackingField = transformBackingField(backingField, data, shouldResolveEverything = true) + + private fun transformBackingField( + backingField: FirBackingField, + data: ResolutionMode, + shouldResolveEverything: Boolean, ): FirBackingField = whileAnalysing(session, backingField) { val propertyType = data.expectedType val initializerData = when { @@ -1094,7 +1156,10 @@ open class FirDeclarationsResolveTransformer( else -> ResolutionMode.ContextDependent } backingField.transformInitializer(transformer, initializerData) - backingField.transformAnnotations(transformer, data) + if (shouldResolveEverything) { + backingField.transformAnnotations(transformer, data) + } + if ( backingField.returnTypeRef is FirErrorTypeRef || backingField.returnTypeRef is FirResolvedTypeRef @@ -1219,7 +1284,6 @@ open class FirDeclarationsResolveTransformer( return initializer.isResolved && initializer !is FirErrorExpression } - protected val FirFunction.bodyResolved: Boolean - get() = body !is FirLazyBlock && body?.isResolved == true - + private val FirFunction.bodyResolved: Boolean + get() = body?.isResolved == true } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsMappingTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsMappingTransformer.kt index 9f05771e91c..876cf770e76 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsMappingTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/plugin/FirAnnotationArgumentsMappingTransformer.kt @@ -119,10 +119,6 @@ private class FirDeclarationsResolveTransformerForAnnotationArgumentsMapping( simpleFunction: FirSimpleFunction, data: ResolutionMode ): FirSimpleFunction { - if (simpleFunction.bodyResolved) { - return simpleFunction - } - doTransformTypeParameters(simpleFunction) context.withSimpleFunction(simpleFunction, session) { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyBodyResolveState.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyBodyResolveState.kt index 925fc9427b8..f040b2e11cf 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyBodyResolveState.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyBodyResolveState.kt @@ -10,5 +10,5 @@ enum class FirPropertyBodyResolveState { NOTHING_RESOLVED, INITIALIZER_RESOLVED, INITIALIZER_AND_GETTER_RESOLVED, - EVERYTHING_RESOLVED + ALL_BODIES_RESOLVED, } \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt index 9271ac7331c..48403630c6d 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/synthetic/FirSyntheticProperty.kt @@ -85,7 +85,7 @@ class FirSyntheticProperty( override val attributes: FirDeclarationAttributes = FirDeclarationAttributes() override val bodyResolveState: FirPropertyBodyResolveState - get() = FirPropertyBodyResolveState.EVERYTHING_RESOLVED + get() = FirPropertyBodyResolveState.ALL_BODIES_RESOLVED override val contextReceivers: List get() = emptyList() diff --git a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.fir.kt b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.fir.kt deleted file mode 100644 index 21c3066e89b..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// Functions can be recursively annotated -annotation class ann(val x: Int) -@ann(bar()) fun foo() = 1 -@ann(foo()) fun bar() = 2 diff --git a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt index 552ec93b99e..0d6908a2d27 100644 --- a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Functions can be recursively annotated annotation class ann(val x: Int) @ann(bar()) fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.reversed.kt b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.reversed.kt deleted file mode 100644 index 17c6c2a5362..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.reversed.kt +++ /dev/null @@ -1,4 +0,0 @@ -// Functions can be recursively annotated -annotation class ann(val x: Int) -@ann(bar()) fun foo() = 1 -@ann(foo()) fun bar() = 2 diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.fir.kt deleted file mode 100644 index 4eb8bf11a92..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Functions can be recursively annotated -annotation class ann(val x: Int) -@ann(foo()) fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt index bdd06ee6027..50ac5b3eabe 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Functions can be recursively annotated annotation class ann(val x: Int) @ann(foo()) fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.fir.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.fir.kt deleted file mode 100644 index 0851c4bb7d0..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -package myPack - -annotation class Anno(val number: Int) - -@Anno(function(42)) -fun function(@Anno(function(24)) param: Int = function(0)) = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt index b748691e4df..ef6c1bfbb7e 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package myPack annotation class Anno(val number: Int) diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt index 8debe57ab34..3c50bbcf7b6 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnFunctionParameterType.kt @@ -4,4 +4,4 @@ package myPack @Target(AnnotationTarget.TYPE) annotation class Anno(val number: Int) -fun function(param: @Anno(function(42)) Int) = 1 +fun function(param: @Anno(function(42)) Int) = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.fir.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.fir.kt deleted file mode 100644 index 2a0b70a9eae..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -package myPack - -annotation class Anno(val number: Int) - -@Anno(prop) -var prop - @Anno(prop) - get() = 22 - @Anno(prop) - set(@Anno(prop) value) = Unit diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt index 49179de45c9..da79ae14739 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package myPack annotation class Anno(val number: Int) diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.fir.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.fir.kt deleted file mode 100644 index 41b918bda24..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -package myPack - -annotation class Anno(val number: Int) - -fun @receiver:Anno(42.function()) Int.function() = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt index 5f9f0b6c41e..10de6239bb2 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package myPack annotation class Anno(val number: Int) diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.fir.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.fir.kt deleted file mode 100644 index 6eef8a1797a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -package myPack - -annotation class Anno(val number: Int) - -val @receiver:Anno(42.prop) Int.prop get() = 22 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt index f2e7339bbd4..1d99e9e7fdb 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnReceiverParameterProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package myPack annotation class Anno(val number: Int) diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt index 853a68d4e28..b33d170dd05 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterFunction.kt @@ -4,4 +4,4 @@ package myPack @Target(AnnotationTarget.TYPE_PARAMETER) annotation class Anno(val number: Int) -fun <@Anno(function()) T> function() = 1 +fun <@Anno(function()) T> function() = 1 diff --git a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt index a7017de9c38..79a4107b403 100644 --- a/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/cycleAnnotationOnTypeParameterProperty.kt @@ -4,4 +4,4 @@ package myPack @Target(AnnotationTarget.TYPE_PARAMETER) annotation class Anno(val number: Int) -val <@Anno(42.prop) T> T.prop get() = 22 +val <@Anno(42.prop) T> T.prop get() = 22