From 9846ec23dfb40198a9d57552d5f89d3dc1219911 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 18 Aug 2023 17:28:17 +0200 Subject: [PATCH] Raw FIR: generate 'return setValue' instead of just 'setValue' #KT-61045 Fixed --- ...KtFirPropertyDelegationMethodsReference.kt | 2 +- .../testdata/lazyResolve/delegates.txt | 56 +++++++++---------- .../testdata/lazyResolve/delegatesScript.txt | 56 +++++++++---------- .../callOnThisInDelegateExpression.fir.txt | 2 +- .../delegates/delegateInference.fir.txt | 4 +- .../resolve/delegates/kt41982.fir.txt | 2 +- .../inapplicableLateinitModifier.fir.txt | 2 +- .../delegates/delegateTypeMismatch.fir.txt | 4 +- .../delegates/delegateWithAnonymousObject.dot | 11 +++- .../delegateWithAnonymousObject.fir.txt | 2 +- .../delegates/nullableTypeDelegate.fir.txt | 2 +- .../propertyWithFunctionalType.fir.txt | 4 +- .../delegates/simpleDelegatedToMap.fir.txt | 4 +- .../declarations/delegates.lazyBodies.txt | 2 +- .../rawBuilder/declarations/delegates.txt | 2 +- .../kotlin/fir/builder/ConversionUtils.kt | 36 +++++++----- .../inference/delegates/kt50994.fir.txt | 12 ++-- .../delegates/kt50994.reversed.fir.txt | 12 ++-- ...ropertyAccessorsWithAnnotations.fir.ir.txt | 11 ++-- ...ropertyAccessorsWithAnnotations.fir.kt.txt | 2 +- .../classLevelProperties.fir.ir.txt | 15 ++--- .../classLevelProperties.fir.kt.txt | 3 +- .../delegatedPropertiesOperators.fir.ir.txt | 17 +++--- .../delegatedPropertiesOperators.fir.kt.txt | 2 +- .../delegatedProperties.fir.ir.txt | 28 +++++----- .../delegatedProperties.fir.kt.txt | 5 +- .../genericDelegatedProperty.fir.ir.txt | 13 +++-- .../genericDelegatedProperty.fir.kt.txt | 2 +- .../localDelegatedProperties.fir.ir.txt | 13 +++-- .../localDelegatedProperties.fir.kt.txt | 3 +- .../packageLevelProperties.fir.ir.txt | 13 +++-- .../packageLevelProperties.fir.kt.txt | 3 +- .../provideDelegate/javaDelegate.fir.ir.txt | 26 +++++---- .../expressions/propertyReferences.fir.ir.txt | 11 ++-- .../expressions/propertyReferences.fir.kt.txt | 2 +- .../firProblems/readWriteProperty.fir.ir.txt | 13 +++-- .../firProblems/readWriteProperty.fir.kt.txt | 2 +- 37 files changed, 209 insertions(+), 190 deletions(-) diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirPropertyDelegationMethodsReference.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirPropertyDelegationMethodsReference.kt index d55fab179a1..67af514d592 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirPropertyDelegationMethodsReference.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirPropertyDelegationMethodsReference.kt @@ -27,7 +27,7 @@ class KtFirPropertyDelegationMethodsReference( val property = (expression.parent as? KtElement)?.getOrBuildFirSafe(firResolveSession) ?: return emptyList() if (property.delegate == null) return emptyList() val getValueSymbol = (property.getter?.singleStatementOfType()?.result as? FirFunctionCall)?.getCalleeSymbol() - val setValueSymbol = property.setter?.singleStatementOfType()?.getCalleeSymbol() + val setValueSymbol = (property.setter?.singleStatementOfType()?.result as? FirFunctionCall)?.getCalleeSymbol() return listOfNotNull( getValueSymbol?.fir?.buildSymbol(firSymbolBuilder), setValueSymbol?.fir?.buildSymbol(firSymbolBuilder) diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegates.txt b/analysis/low-level-api-fir/testdata/lazyResolve/delegates.txt index ef3b82e41d7..3389aa935c0 100644 --- a/analysis/low-level-api-fir/testdata/lazyResolve/delegates.txt +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegates.txt @@ -17,14 +17,14 @@ FILE: [ResolvedTo(RAW_FIR)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } IMPORTS: @@ -46,14 +46,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } COMPILER_REQUIRED_ANNOTATIONS: @@ -75,14 +75,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } COMPANION_GENERATION: @@ -104,14 +104,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } SUPER_TYPES: @@ -133,14 +133,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } TYPES: @@ -162,14 +162,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } STATUS: @@ -191,14 +191,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } EXPECT_ACTUAL_MATCHING: @@ -220,14 +220,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } ARGUMENTS_OF_ANNOTATIONS: @@ -249,14 +249,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } CONTRACTS: @@ -283,14 +283,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } IMPLICIT_TYPES_BODY_RESOLVE: @@ -317,14 +317,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } ANNOTATIONS_ARGUMENTS_MAPPING: @@ -351,14 +351,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION public? [ResolvedTo(RAW_FIR)] get(): { ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } BODY_RESOLVE: @@ -399,14 +399,14 @@ FILE: [ResolvedTo(IMPORTS)] delegates.kt ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public [ResolvedTo(CONTRACTS)] set([ResolvedTo(CONTRACTS)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableWithImplicitType: R|kotlin/Int|by R|/delegate| public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| { ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|) } public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } FILE RAW TO BODY: @@ -447,12 +447,12 @@ FILE: [ResolvedTo(BODY_RESOLVE)] delegates.kt ^ D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|) } public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public final [ResolvedTo(BODY_RESOLVE)] var variableWithImplicitType: R|kotlin/Int|by R|/delegate| public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| { ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|) } public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegatesScript.txt b/analysis/low-level-api-fir/testdata/lazyResolve/delegatesScript.txt index 979e96a7eab..d96c327a35a 100644 --- a/analysis/low-level-api-fir/testdata/lazyResolve/delegatesScript.txt +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegatesScript.txt @@ -26,7 +26,7 @@ FILE: [ResolvedTo(RAW_FIR)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -34,7 +34,7 @@ FILE: [ResolvedTo(RAW_FIR)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -66,7 +66,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -74,7 +74,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -106,7 +106,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -114,7 +114,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -146,7 +146,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -154,7 +154,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -186,7 +186,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -194,7 +194,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -226,7 +226,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -234,7 +234,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -266,7 +266,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -274,7 +274,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -306,7 +306,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -314,7 +314,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -346,7 +346,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -354,7 +354,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -391,7 +391,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -399,7 +399,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -436,7 +436,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -444,7 +444,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -481,7 +481,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public? final? [ResolvedTo(RAW_FIR)] var variableWithImplicitType: by LAZY_EXPRESSION @@ -489,7 +489,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.getValue#(Null(null), ::R|/variableWithImplicitType|) } public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] : ): R|kotlin/Unit| { - D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.setValue#(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -540,7 +540,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithExplicitType|.getValue#(Null(null), ::R|/variableWithExplicitType|) } public [ResolvedTo(CONTRACTS)] set([ResolvedTo(CONTRACTS)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.setValue#(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var variableWithImplicitType: R|kotlin/Int|by R|/delegate| @@ -548,7 +548,7 @@ FILE: [ResolvedTo(IMPORTS)] delegatesScript.kts ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|) } public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } @@ -599,7 +599,7 @@ FILE: [ResolvedTo(BODY_RESOLVE)] delegatesScript.kts ^ D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|) } public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) + ^ D|/variableWithExplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithExplicitType|, R|/variableWithExplicitType|) } public final [ResolvedTo(BODY_RESOLVE)] var variableWithImplicitType: R|kotlin/Int|by R|/delegate| @@ -607,6 +607,6 @@ FILE: [ResolvedTo(BODY_RESOLVE)] delegatesScript.kts ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|) } public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] : R|kotlin/Int|): R|kotlin/Unit| { - D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) + ^ D|/variableWithImplicitType|.R|SubstitutionOverride|(Null(null), ::R|/variableWithImplicitType|, R|/variableWithImplicitType|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/callOnThisInDelegateExpression.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/callOnThisInDelegateExpression.fir.txt index c3d91da0777..dc5f21f3cdb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/callOnThisInDelegateExpression.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/callOnThisInDelegateExpression.fir.txt @@ -23,7 +23,7 @@ FILE: callOnThisInDelegateExpression.kt ^ this@R|/SomeImpl|.D|/SomeImpl.bundle|.R|SubstitutionOverride|(this@R|/SomeImpl|, ::R|/SomeImpl.bundle|) } public set(: R|R?|): R|kotlin/Unit| { - this@R|/SomeImpl|.D|/SomeImpl.bundle|.R|SubstitutionOverride|(this@R|/SomeImpl|, ::R|/SomeImpl.bundle|, R|/bundle|) + ^ this@R|/SomeImpl|.D|/SomeImpl.bundle|.R|SubstitutionOverride|(this@R|/SomeImpl|, ::R|/SomeImpl.bundle|, R|/bundle|) } public final fun |, T : R|Some|> getFactory(): R|Factory| { diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt index 782f38286ca..0e1971f4e89 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.fir.txt @@ -45,7 +45,7 @@ FILE: delegateInference.kt ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|) } public set(: R|kotlin/Boolean|): R|kotlin/Unit| { - this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) + ^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.x|, R|/x|) } public final var y: R|kotlin/String|by R|/FreezableVar.FreezableVar|(String()) @@ -53,7 +53,7 @@ FILE: delegateInference.kt ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|) } public set(: R|kotlin/String|): R|kotlin/Unit| { - this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) + ^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.y|, R|/y|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.fir.txt index 0a81a199ef7..5c2de6e7459 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.fir.txt @@ -34,7 +34,7 @@ FILE: kt41982.kt ^ this@R|/Test|.D|/Test.start|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.start|) } public set(: R|kotlin/Long|): R|kotlin/Unit| { - this@R|/Test|.D|/Test.start|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.start|, R|/start|) + ^ this@R|/Test|.D|/Test.start|.R|SubstitutionOverride|(this@R|/Test|, ::R|/Test.start|, R|/start|) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.fir.txt index 25ee479401a..baff460e875 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.fir.txt @@ -20,7 +20,7 @@ FILE: inapplicableLateinitModifier.kt ^ D|/kest|.R|/Delegate.getValue|(Null(null), ::R|/kest|) } public set(: R|kotlin/String|): R|kotlin/Unit| { - D|/kest|.R|/Delegate.setValue|(Null(null), ::R|/kest|, R|/kest|) + ^ D|/kest|.R|/Delegate.setValue|(Null(null), ::R|/kest|, R|/kest|) } public final lateinit var good: R|kotlin/String| public get(): R|kotlin/String| diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt index b8c994d73e5..1d9faccd665 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.fir.txt @@ -38,7 +38,7 @@ FILE: delegateTypeMismatch.kt ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|) } public set(: R|ClassifierNamePolicy|): R|kotlin/Unit| { - this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) + ^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|/classifierNamePolicy|) } public final var typeNormalizer: R|(KotlinType) -> KotlinType|by this@R|/A|.R|/A.property| KotlinType|>(property@fun (it: R|KotlinType|): R|KotlinType| { @@ -49,7 +49,7 @@ FILE: delegateTypeMismatch.kt ^ this@R|/A|.D|/A.typeNormalizer|.R|SubstitutionOverride KotlinType|>|(this@R|/A|, ::R|/A.typeNormalizer|) } public set(: R|(KotlinType) -> KotlinType|): R|kotlin/Unit| { - this@R|/A|.D|/A.typeNormalizer|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.typeNormalizer|, R|/typeNormalizer|) + ^ this@R|/A|.D|/A.typeNormalizer|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.typeNormalizer|, R|/typeNormalizer|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index f9b43a6f36e..59ef9dfdbf5 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -230,15 +230,20 @@ digraph delegateWithAnonymousObject_kt { 72 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 73 [label="Access variable R|/issueListView|"]; 74 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; - 75 [label="Exit block"]; + 75 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|)"]; + 76 [label="Stub" style="filled" fillcolor=gray]; + 77 [label="Exit block" style="filled" fillcolor=gray]; } - 76 [label="Exit function " style="filled" fillcolor=red]; + 78 [label="Exit function " style="filled" fillcolor=red]; } 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; - 75 -> {76}; + 75 -> {78}; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt index 2323ab9e276..4c4284ad189 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt @@ -44,7 +44,7 @@ FILE: delegateWithAnonymousObject.kt ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|) } public set(: R|IssueListView|): R|kotlin/Unit| { - this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) + ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|/issueListView|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt index cddb73e6010..1426ca2921e 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/nullableTypeDelegate.fir.txt @@ -22,7 +22,7 @@ FILE: nullableTypeDelegate.kt ^ this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|) } public set(: R|MyClassSome?|): R|kotlin/Unit| { - this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|, R|/other|) + ^ this@R|/MyClassSome|.D|/MyClassSome.other|.R|SubstitutionOverride|(this@R|/MyClassSome|, ::R|/MyClassSome.other|, R|/other|) } public final fun set(link: R|MyClassSome?|): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt index 02d088ad5b2..5984fafbc39 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.fir.txt @@ -18,7 +18,7 @@ FILE: propertyWithFunctionalType.kt ^ this@R|/A|.D|/A.conventer|.R|SubstitutionOverride B|>|(this@R|/A|, ::R|/A.conventer|) } public set(: R|(B) -> B|): R|kotlin/Unit| { - this@R|/A|.D|/A.conventer|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventer|, R|/conventer|) + ^ this@R|/A|.D|/A.conventer|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventer|, R|/conventer|) } public final var conventerWithExpectedType: R|(B) -> B|by this@R|/A|.R|/A.property| B|>(property@fun (it: R|B|): R|B| { @@ -29,7 +29,7 @@ FILE: propertyWithFunctionalType.kt ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|) } public set(: R|(B) -> B|): R|kotlin/Unit| { - this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) + ^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|/conventerWithExpectedType|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.fir.txt index b80682f1557..d6054007eac 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.fir.txt @@ -12,7 +12,7 @@ FILE: simpleDelegatedToMap.kt ^ this@R|/C|.D|/C.foo|.R|kotlin/collections/getValue|(this@R|/C|, ::R|/C.foo|) } public set(: R|kotlin/Any|): R|kotlin/Unit| { - this@R|/C|.D|/C.foo|.R|kotlin/collections/setValue|(this@R|/C|, ::R|/C.foo|, R|/foo|) + ^ this@R|/C|.D|/C.foo|.R|kotlin/collections/setValue|(this@R|/C|, ::R|/C.foo|, R|/foo|) } } @@ -21,5 +21,5 @@ FILE: simpleDelegatedToMap.kt ^ D|/bar|.R|kotlin/collections/getValue|(Null(null), ::R|/bar|) } public set(: R|kotlin/Any|): R|kotlin/Unit| { - D|/bar|.R|kotlin/collections/setValue|(Null(null), ::R|/bar|, R|/bar|) + ^ D|/bar|.R|kotlin/collections/setValue|(Null(null), ::R|/bar|, R|/bar|) } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.lazyBodies.txt index e038c6941d6..e794593cb0f 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.lazyBodies.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.lazyBodies.txt @@ -14,7 +14,7 @@ FILE: delegates.kt ^ D|/variable|.getValue#(Null(null), ::R|/variable|) } public? set(: ): R|kotlin/Unit| { - D|/variable|.setValue#(Null(null), ::R|/variable|, R|/variable|) + ^ D|/variable|.setValue#(Null(null), ::R|/variable|, R|/variable|) } public? final? interface Base : R|kotlin/Any| { } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.txt index 8fa20779f63..f63837c447c 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.txt @@ -30,7 +30,7 @@ FILE: delegates.kt ^ D|/variable|.getValue#(Null(null), ::R|/variable|) } public? set(: ): R|kotlin/Unit| { - D|/variable|.setValue#(Null(null), ::R|/variable|, R|/variable|) + ^ D|/variable|.setValue#(Null(null), ::R|/variable|, R|/variable|) } public? final? interface Base : R|kotlin/Any| { } diff --git a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt index a0abe228795..1940bf1d222 100644 --- a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt +++ b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/ConversionUtils.kt @@ -462,6 +462,7 @@ fun FirPropertyBuilder.generateAccessorsByDelegate( } if (isVar && (setter == null || setter is FirDefaultPropertyAccessor)) { val annotations = setter?.annotations + val returnTarget = FirFunctionTarget(null, isLambda = false) val parameterAnnotations = setter?.valueParameters?.firstOrNull()?.annotations val setterStatus = setter?.status val setterElement = setter?.source?.fakeElement(KtFakeSourceElementKind.DelegatedPropertyAccessor) ?: fakeSource @@ -492,25 +493,29 @@ fun FirPropertyBuilder.generateAccessorsByDelegate( } valueParameters += parameter body = FirSingleExpressionBlock( - buildFunctionCall { - source = fakeSource - explicitReceiver = delegateAccess() - calleeReference = buildSimpleNamedReference { + buildReturnExpression { + result = buildFunctionCall { source = fakeSource - name = OperatorNameConventions.SET_VALUE - } - argumentList = buildArgumentList { - arguments += thisRef() - arguments += propertyRef() - arguments += buildPropertyAccessExpression { - calleeReference = buildResolvedNamedReference { - source = fakeSource - name = SpecialNames.IMPLICIT_SET_PARAMETER - resolvedSymbol = parameter.symbol + explicitReceiver = delegateAccess() + calleeReference = buildSimpleNamedReference { + source = fakeSource + name = OperatorNameConventions.SET_VALUE + } + argumentList = buildArgumentList { + arguments += thisRef() + arguments += propertyRef() + arguments += buildPropertyAccessExpression { + calleeReference = buildResolvedNamedReference { + source = fakeSource + name = SpecialNames.IMPLICIT_SET_PARAMETER + resolvedSymbol = parameter.symbol + } } } + origin = FirFunctionCallOrigin.Operator } - origin = FirFunctionCallOrigin.Operator + target = returnTarget + source = fakeSource } ) if (annotations != null) { @@ -518,6 +523,7 @@ fun FirPropertyBuilder.generateAccessorsByDelegate( } propertySymbol = this@generateAccessorsByDelegate.symbol }.also { + returnTarget.bind(it) it.initContainingClassAttr(context) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.fir.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.fir.txt index e92f06139b9..5401745ac20 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.fir.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.fir.txt @@ -9,7 +9,7 @@ FILE: kt50994.fir.kt ^ this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|) } public set(: R|ProcessorWithChildren?|): R|kotlin/Unit| { - this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|, R|/processor|) + ^ this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|, R|/processor|) } } @@ -23,7 +23,7 @@ FILE: kt50994.fir.kt ^ this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|>|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|, R|/processors|) + ^ this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|, R|/processors|) } } @@ -37,7 +37,7 @@ FILE: kt50994.fir.kt ^ this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|) } public set(: R|Processor2WithChildren?|): R|kotlin/Unit| { - this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|, R|/processor|) + ^ this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|, R|/processor|) } } @@ -51,7 +51,7 @@ FILE: kt50994.fir.kt ^ this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|>|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|, R|/processors|) + ^ this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|, R|/processors|) } } @@ -65,7 +65,7 @@ FILE: kt50994.fir.kt ^ this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|) } public set(: R|Processor3WithChildren?|): R|kotlin/Unit| { - this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|, R|/processor|) + ^ this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|, R|/processor|) } } @@ -79,7 +79,7 @@ FILE: kt50994.fir.kt ^ this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|>|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|, R|/processors|) + ^ this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|, R|/processors|) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.reversed.fir.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.reversed.fir.txt index e38aaafef12..344db56b48a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.reversed.fir.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt50994.reversed.fir.txt @@ -9,7 +9,7 @@ FILE: kt50994.reversed.kt ^ this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|) } public set(: R|ProcessorWithChildren?|): R|kotlin/Unit| { - this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|, R|/processor|) + ^ this@R|/ProcessorWithParent|.D|/ProcessorWithParent.processor|.R|SubstitutionOverride|(this@R|/ProcessorWithParent|, ::R|/ProcessorWithParent.processor|, R|/processor|) } } @@ -23,7 +23,7 @@ FILE: kt50994.reversed.kt ^ this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|>|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|, R|/processors|) + ^ this@R|/ProcessorWithChildren|.D|/ProcessorWithChildren.processors|.R|SubstitutionOverride|(this@R|/ProcessorWithChildren|, ::R|/ProcessorWithChildren.processors|, R|/processors|) } } @@ -37,7 +37,7 @@ FILE: kt50994.reversed.kt ^ this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|) } public set(: R|Processor2WithChildren?|): R|kotlin/Unit| { - this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|, R|/processor|) + ^ this@R|/Processor2WithParent|.D|/Processor2WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor2WithParent|, ::R|/Processor2WithParent.processor|, R|/processor|) } } @@ -51,7 +51,7 @@ FILE: kt50994.reversed.kt ^ this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|>|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|, R|/processors|) + ^ this@R|/Processor2WithChildren|.D|/Processor2WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor2WithChildren|, ::R|/Processor2WithChildren.processors|, R|/processors|) } } @@ -65,7 +65,7 @@ FILE: kt50994.reversed.kt ^ this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|) } public set(: R|Processor3WithChildren?|): R|kotlin/Unit| { - this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|, R|/processor|) + ^ this@R|/Processor3WithParent|.D|/Processor3WithParent.processor|.R|SubstitutionOverride|(this@R|/Processor3WithParent|, ::R|/Processor3WithParent.processor|, R|/processor|) } } @@ -79,7 +79,7 @@ FILE: kt50994.reversed.kt ^ this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|>|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|) } public set(: R|kotlin/collections/MutableCollection|): R|kotlin/Unit| { - this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|, R|/processors|) + ^ this@R|/Processor3WithChildren|.D|/Processor3WithChildren.processors|.R|SubstitutionOverride|(this@R|/Processor3WithChildren|, ::R|/Processor3WithChildren.processors|, R|/processors|) } } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt index 6337d311ef6..efeb5b2d5bb 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt @@ -124,8 +124,9 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt annotations: A(x = 'test2.set.param') BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt index e5a5858e7c3..2a9511c3c79 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt @@ -48,5 +48,5 @@ var test2: Int /* by */ } @A(x = "test2.set") set(@A(x = "test2.set.param") : Int) { - #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = ) + return #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = ) } diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt index 10535245071..d3ce4716418 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt @@ -135,13 +135,14 @@ FILE fqName: fileName:/classLevelProperties.kt $this: VALUE_PARAMETER name: type:.C VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' type=java.util.HashMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in .C' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Int + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' type=java.util.HashMap origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt index 4b07fa2264b..7febedbcc3e 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt @@ -50,8 +50,7 @@ class C { return .#test8$delegate.getValue(thisRef = , property = C::test8) } set(: Int) { - .#test8$delegate.setValue(thisRef = , property = C::test8, value = ) + return .#test8$delegate.setValue(thisRef = , property = C::test8, value = ) } } - diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt index d68f162cb8f..94b5bc67b8c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt @@ -113,14 +113,15 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $this: VALUE_PARAMETER name: type:.Result VALUE_PARAMETER name: index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun setValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.String declared in .Result.' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.String): kotlin.Unit declared in .Result' + CALL 'public final fun setValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null + receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null + $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null + thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null + property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.String declared in .Result.' type=kotlin.String origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt index dda10edc693..0d6a1df16bf 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt @@ -42,7 +42,7 @@ class Result { return .#s$delegate.getValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s) } set(: String) { - .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) + return .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) } } diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt index 2a659014245..61afb73e2d9 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt @@ -79,13 +79,14 @@ FILE fqName: fileName:/delegatedProperties.kt $this: VALUE_PARAMETER name: type:.C VALUE_PARAMETER name: index:0 type:kotlin.Any BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' type=kotlin.collections.MutableMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test3: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Any declared in .C.' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in .C' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' type=kotlin.collections.MutableMap origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null + property: PROPERTY_REFERENCE 'public final test3: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Any declared in .C.' type=kotlin.Any origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -119,9 +120,10 @@ FILE fqName: fileName:/delegatedProperties.kt correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Any BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Any + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt index 9bcdb5124f0..59dff52a6ac 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt @@ -33,7 +33,7 @@ class C { return .#test3$delegate.getValue(thisRef = , property = C::test3) } set(: Any) { - .#test3$delegate.setValue(thisRef = , property = C::test3, value = ) + return .#test3$delegate.setValue(thisRef = , property = C::test3, value = ) } } @@ -44,6 +44,5 @@ var test4: Any /* by */ return #test4$delegate.getValue(thisRef = null, property = ::test4) } set(: Any) { - #test4$delegate.setValue(thisRef = null, property = ::test4, value = ) + return #test4$delegate.setValue(thisRef = null, property = ::test4, value = ) } - diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt index f37becfdd4e..320dca7e25a 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt @@ -72,9 +72,10 @@ FILE fqName: fileName:/genericDelegatedProperty.kt $receiver: VALUE_PARAMETER name: type:.C.> VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null - thisRef: GET_VAR ': .C.> declared in .' type=.C.> origin=null - kProp: PROPERTY_REFERENCE 'public final genericDelegatedProperty: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1<.C.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null + thisRef: GET_VAR ': .C.> declared in .' type=.C.> origin=null + kProp: PROPERTY_REFERENCE 'public final genericDelegatedProperty: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + <1>: T of . + newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt index 3babc4f706a..27b6bfe00a3 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt @@ -29,5 +29,5 @@ var C.genericDelegatedProperty: Int /* by */ return #genericDelegatedProperty$delegate.getValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/) } set(: Int) { - #genericDelegatedProperty$delegate.setValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/, newValue = ) + return #genericDelegatedProperty$delegate.setValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/, newValue = ) } diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt index 23e030b3804..b6fb0cffa90 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt @@ -39,12 +39,13 @@ FILE fqName: fileName:/localDelegatedProperties.kt FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:local modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Int - $receiver: GET_VAR 'val x$delegate: java.util.HashMap declared in .test2' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'var x: kotlin.Int by (...)' delegate='val x$delegate: java.util.HashMap declared in .test2' getter='local final fun (): kotlin.Int declared in .test2' setter='local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .test2.' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='local final fun (: kotlin.Int): kotlin.Unit declared in .test2' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Int + $receiver: GET_VAR 'val x$delegate: java.util.HashMap declared in .test2' type=java.util.HashMap origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'var x: kotlin.Int by (...)' delegate='val x$delegate: java.util.HashMap declared in .test2' getter='local final fun (): kotlin.Int declared in .test2' setter='local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int declared in .test2.' type=kotlin.Int origin=null CALL 'local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.Unit origin=EQ : CONST Int type=kotlin.Int value=0 TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt index 798ee45f1f1..fc163cb0e75 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt @@ -18,7 +18,7 @@ fun test2() { return x$delegate.getValue(thisRef = null, property = ::x) } local set(: Int) { - x$delegate.setValue(thisRef = null, property = ::x, value = ) + return x$delegate.setValue(thisRef = null, property = ::x, value = ) } ( = 0) @@ -29,4 +29,3 @@ fun test2() { } /*~> Unit */ ( = ().plus(other = 1)) } - diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt index dec8c6e8554..c867f735344 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt @@ -107,9 +107,10 @@ FILE fqName: fileName:/packageLevelProperties.kt correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null + : kotlin.Int + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt index 3954fb504b2..5db7671b429 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt @@ -43,6 +43,5 @@ var test8: Int /* by */ return #test8$delegate.getValue(thisRef = null, property = ::test8) } set(: Int) { - #test8$delegate.setValue(thisRef = null, property = ::test8, value = ) + return #test8$delegate.setValue(thisRef = null, property = ::test8, value = ) } - diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt index 787234bc391..afa7f8dc01a 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt @@ -17,12 +17,13 @@ FILE fqName:k fileName:/box.kt correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:@[FlexibleNullability] kotlin.String? BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.setValue): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null - : @[FlexibleNullability] kotlin.String? - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p1$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final p1: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null + RETURN type=kotlin.Nothing from='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.setValue): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p1$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final p1: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null PROPERTY name:p2 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:p2$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static] EXPRESSION_BODY @@ -41,12 +42,13 @@ FILE fqName:k fileName:/box.kt correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:@[FlexibleNullability] kotlin.String? BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.setValue): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null - : @[FlexibleNullability] kotlin.String? - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p2$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final p2: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null + RETURN type=kotlin.Nothing from='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.setValue): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p2$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + property: PROPERTY_REFERENCE 'public final p2: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY CALL 'public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.Unit origin=EQ diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt index ffe710879c7..0a7672d056e 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt @@ -225,11 +225,12 @@ FILE fqName: fileName:/propertyReferences.kt correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY - CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' + CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null + thisRef: CONST Null type=kotlin.Nothing? value=null + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt index 7e089c78274..45cad43651f 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.kt.txt @@ -99,7 +99,7 @@ var delegatedVar: Int /* by */ return #delegatedVar$delegate.getValue(thisRef = null, kProp = ::delegatedVar) } set(: Int) { - #delegatedVar$delegate.setValue(thisRef = null, kProp = ::delegatedVar, value = ) + return #delegatedVar$delegate.setValue(thisRef = null, kProp = ::delegatedVar, value = ) } val test_delegatedVar: KMutableProperty0 diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt index 52cdd42c6c3..c802b814405 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt @@ -128,12 +128,13 @@ FILE fqName: fileName:/readWriteProperty.kt $this: VALUE_PARAMETER name: type:.IdeWizard VALUE_PARAMETER name: index:0 type:kotlin.Int? BLOCK_BODY - CALL 'public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null - receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int? declared in .IdeWizard.' type=kotlin.Int? origin=null + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' + CALL 'public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null + receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null + property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int? declared in .IdeWizard.' type=kotlin.Int? origin=null FUN name:setting visibility:private modality:FINAL ($this:.IdeWizard, reference:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting>) returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.IdeWizard.setting>] reified:false diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt index 7093200728b..895e9c43fc1 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt @@ -43,7 +43,7 @@ class IdeWizard { return .#projectTemplate$delegate.getValue(thisRef = , property = IdeWizard::projectTemplate) } set(: Int?) { - .#projectTemplate$delegate.setValue(thisRef = , property = IdeWizard::projectTemplate, value = ) + return .#projectTemplate$delegate.setValue(thisRef = , property = IdeWizard::projectTemplate, value = ) } private fun > setting(reference: SettingReference): {