diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index ecba82e7912..b7e160b642c 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -51,12 +51,18 @@ internal class CallAndReferenceGenerator( return callableReferenceAccess.convertWithOffsets { startOffset, endOffset -> when (symbol) { is IrPropertySymbol -> { + val referencedProperty = symbol.owner + val referencedPropertyGetter = referencedProperty.getter + val backingFieldSymbol = when { + referencedPropertyGetter != null -> null + else -> referencedProperty.backingField?.symbol + } IrPropertyReferenceImpl( startOffset, endOffset, type, symbol, - typeArgumentsCount = symbol.owner.getter?.typeParameters?.size ?: 0, - symbol.owner.backingField?.symbol, - symbol.owner.getter?.symbol, - symbol.owner.setter?.symbol + typeArgumentsCount = referencedPropertyGetter?.typeParameters?.size ?: 0, + backingFieldSymbol, + referencedPropertyGetter?.symbol, + referencedProperty.setter?.symbol ) } is IrFunctionSymbol -> { diff --git a/compiler/testData/codegen/box/callableReference/property/delegatedMutable.kt b/compiler/testData/codegen/box/callableReference/property/delegatedMutable.kt index 4fcd561eaca..3bc30b3c17d 100644 --- a/compiler/testData/codegen/box/callableReference/property/delegatedMutable.kt +++ b/compiler/testData/codegen/box/callableReference/property/delegatedMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty var result: String by Delegate diff --git a/compiler/testData/codegen/box/callableReference/property/overriddenInSubclass.kt b/compiler/testData/codegen/box/callableReference/property/overriddenInSubclass.kt index de204a324ab..d892efcba29 100644 --- a/compiler/testData/codegen/box/callableReference/property/overriddenInSubclass.kt +++ b/compiler/testData/codegen/box/callableReference/property/overriddenInSubclass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Base { open val foo = "Base" } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt index 9584f97261f..b3d0a543985 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt @@ -35,4 +35,4 @@ FILE fqName: fileName:/delegateFieldWithAnnotations.kt : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt index 85ada12565b..b5f8ce8443d 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt @@ -97,7 +97,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] annotations: A(x = 'test2.get') @@ -114,7 +114,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int [operator] declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -122,5 +122,5 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit [operator] 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=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt index 48c653a8d5c..7e7802820b6 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt @@ -110,7 +110,7 @@ FILE fqName: fileName:/classLevelProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: GET_VAR ': .C declared in .C' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] EXPRESSION_BODY @@ -124,7 +124,7 @@ FILE fqName: fileName:/classLevelProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -132,7 +132,7 @@ FILE fqName: fileName:/classLevelProperties.kt BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt index 49710e74016..064110498d2 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -17,7 +17,7 @@ FILE fqName: fileName:/delegatedProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] @@ -55,7 +55,7 @@ FILE fqName: fileName:/delegatedProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: GET_VAR ': .C declared in .C' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] EXPRESSION_BODY @@ -67,7 +67,7 @@ FILE fqName: fileName:/delegatedProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -75,7 +75,7 @@ FILE fqName: fileName:/delegatedProperties.kt BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -102,12 +102,12 @@ FILE fqName: fileName:/delegatedProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt index a3e9d523bf3..5047434e5f2 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt @@ -86,7 +86,7 @@ FILE fqName: fileName:/packageLevelProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] EXPRESSION_BODY @@ -99,12 +99,12 @@ FILE fqName: fileName:/packageLevelProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field=null getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt index f4f08fd1b4c..2a2532ddd17 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt @@ -60,7 +60,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String [operator] declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=GET_PROPERTY receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field='FIELD PROPERTY_DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:testK visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -72,7 +72,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String [operator] declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=GET_PROPERTY receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val]' field='FIELD PROPERTY_DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:testOK visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt index 4ff136fb662..e1d58343e0d 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt @@ -100,7 +100,7 @@ FILE fqName: fileName:/member.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=GET_PROPERTY thisRef: GET_VAR ': .Host declared in .Host' type=.Host origin=null - property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field='FIELD PROPERTY_DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> 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 [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index 26d05e16a3c..de4e73e0478 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -75,7 +75,7 @@ FILE fqName: fileName:/memberExtension.kt $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final]' type=.Host.StringDelegate origin=GET_PROPERTY receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host receiver: ERROR_CALL 'Unresolved reference: this@R|/Host.plusK|' type=kotlin.String - p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field='FIELD PROPERTY_DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final]' getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null $this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host $receiver: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host PROPERTY name:ok visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt index 425f1c176ee..1ea6477c84e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt @@ -93,4 +93,4 @@ FILE fqName: fileName:/topLevel.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field='FIELD PROPERTY_DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt deleted file mode 100644 index 6be22a54609..00000000000 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt +++ /dev/null @@ -1,67 +0,0 @@ -FILE fqName: fileName:/boundCallableReferences.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> () returnType:.A [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A 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 [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:qux visibility:public modality:FINAL <> ($receiver:.A) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.A - BLOCK_BODY - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction0 visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public final fun foo (): kotlin.Unit declared in .A' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction0 - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction0 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction0 visibility:private [final,static]' type=kotlin.reflect.KFunction0 origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty0 visibility:private [final,static] - EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field='FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty0 origin=null - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty0 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty0 visibility:private [final,static]' type=kotlin.reflect.KProperty0 origin=null - PROPERTY name:test3 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.reflect.KFunction0 visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public final fun qux (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction0 - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction0 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.reflect.KFunction0 visibility:private [final,static]' type=kotlin.reflect.KFunction0 origin=null diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt index 715ccd5f2b8..6ceef2eb444 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { fun foo() {} val bar = 0 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.fir.txt deleted file mode 100644 index 9770cafb12d..00000000000 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.fir.txt +++ /dev/null @@ -1,53 +0,0 @@ -FILE fqName: fileName:/genericMember.kt - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.A.A> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - PROPERTY name:bar visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.A>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> 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 [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction1<.A, kotlin.Unit> visibility:private [final,static] - EXPRESSION_BODY - FUNCTION_REFERENCE 'public final fun foo (): kotlin.Unit declared in .A' type=kotlin.reflect.KFunction1<.A, kotlin.Unit> origin=null reflectionTarget= - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<.A, kotlin.Unit> - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KFunction1<.A, kotlin.Unit> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction1<.A, kotlin.Unit> visibility:private [final,static]' type=kotlin.reflect.KFunction1<.A, kotlin.Unit> origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty1<.A, kotlin.Int> visibility:private [final,static] - EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field='FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty1<.A, kotlin.Int> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty1<.A, kotlin.Int> - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KProperty1<.A, kotlin.Int> declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty1<.A, kotlin.Int> visibility:private [final,static]' type=kotlin.reflect.KProperty1<.A, kotlin.Int> origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt index 791d303ff9b..3e1547167e1 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { fun foo() {} val bar = 42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.fir.txt index 8b77b267fc6..3cc85cf7c8c 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.fir.txt @@ -37,7 +37,7 @@ FILE fqName:test fileName:/importedFromObject.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field='FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null $this: GET_OBJECT 'CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' type=test.Foo FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] @@ -47,7 +47,7 @@ FILE fqName:test fileName:/importedFromObject.kt PROPERTY name:test1a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field='FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test1a visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt index a3950860bd8..7c590791380 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -68,7 +68,7 @@ FILE fqName: fileName:/genericPropertyRef.kt FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field='FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -78,13 +78,13 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int [operator] declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY t: ERROR_CALL 'Unresolved reference: this@R|/additionalText|' type=.Value.> - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null <1>: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field='FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:private' getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -94,7 +94,7 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int [operator] declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY t: ERROR_CALL 'Unresolved reference: this@R|/additionalValue|' type=.Value.> - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null <1>: CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt index e883e33bbe7..9313addb941 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt @@ -100,7 +100,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_valWithBackingField type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final valWithBackingField: kotlin.Int [val]' field='FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final valWithBackingField: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] BLOCK_BODY @@ -124,7 +124,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingField type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithBackingField: kotlin.Int [var]' field='FIELD PROPERTY_BACKING_FIELD name:varWithBackingField type:kotlin.Int visibility:private [static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final varWithBackingField: kotlin.Int [var]' 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=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] BLOCK_BODY @@ -148,7 +148,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithBackingFieldAndAccessors: kotlin.Int [var]' field='FIELD PROPERTY_BACKING_FIELD name:varWithBackingFieldAndAccessors type:kotlin.Int visibility:private [static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final varWithBackingFieldAndAccessors: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] BLOCK_BODY @@ -199,11 +199,11 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int [operator] declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] BLOCK_BODY @@ -220,7 +220,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int [operator] declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -228,12 +228,12 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit [operator] 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=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null 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 - PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' 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=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] BLOCK_BODY @@ -251,7 +251,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_constVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_constVal type:kotlin.reflect.KProperty0 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final constVal: kotlin.Int [val]' field='FIELD PROPERTY_BACKING_FIELD name:constVal type:kotlin.Int visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final constVal: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_constVal visibility:public modality:FINAL [val] BLOCK_BODY @@ -278,7 +278,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithPrivateSet type:kotlin.reflect.KMutableProperty1<.C, kotlin.Int> visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithPrivateSet: kotlin.Int [var]' field='FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:private' getter='public final fun (): kotlin.Int declared in .C' setter='private final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=null + PROPERTY_REFERENCE 'public final varWithPrivateSet: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter='private final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1<.C, kotlin.Int> correspondingProperty: PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] BLOCK_BODY @@ -287,7 +287,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:kotlin.reflect.KMutableProperty1<.C, kotlin.Int> visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithProtectedSet: kotlin.Int [var]' field='FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:private' getter='public final fun (): kotlin.Int declared in .C' setter='protected final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=null + PROPERTY_REFERENCE 'public final varWithProtectedSet: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter='protected final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1<.C, kotlin.Int> correspondingProperty: PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt index fa324ea5057..d2b5cc04e26 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt @@ -263,7 +263,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepO$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=GET_PROPERTY t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepO|' type=.Value., .CR.>> - p: PROPERTY_REFERENCE 'private final deepO: T of . [delegated,val]' field='FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'private final deepO: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] EXPRESSION_BODY @@ -293,7 +293,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepK$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=GET_PROPERTY t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepK|' type=.Value., .CR.>> - p: PROPERTY_REFERENCE 'private final deepK: T of . [delegated,val]' field='FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'private final deepK: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate., t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:.P., T of .> $this: VALUE_PARAMETER name: type:.additionalText$delegate. VALUE_PARAMETER name:t index:0 type:.Value., .CR.>> @@ -319,5 +319,5 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): .P., T of .> declared in .additionalText$delegate.' type=.P., T of .> origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' type=.additionalText$delegate. origin=GET_PROPERTY t: ERROR_CALL 'Unresolved reference: this@R|/additionalText|' type=.Value., .CR.>> - p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .> [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .> [delegated,val]' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null <1>: