diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 778b2241545..21dd8404514 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -175,6 +175,7 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer) (returnExpression.result as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) } (property.setter?.body?.statements?.singleOrNull() as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) + (property.delegate as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) } private fun transformPropertyWithDelegate(property: FirProperty) { diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt deleted file mode 100644 index f8bb6e49d37..00000000000 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt +++ /dev/null @@ -1,86 +0,0 @@ -FILE fqName: fileName:/differentReceivers.kt - CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .MyClass.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.MyClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass 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:provideDelegate visibility:public modality:FINAL <> ($receiver:.MyClass, host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:.MyClass - VALUE_PARAMETER name:host index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String [operator] declared in ' - CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .MyClass declared in .provideDelegate' type=.MyClass origin=null - FUN name:getValue visibility:public modality:FINAL <> ($receiver:kotlin.String, receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String [operator] - $receiver: VALUE_PARAMETER name: type:kotlin.String - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:p index:1 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String [operator] declared in ' - GET_VAR ': kotlin.String declared in .getValue' type=kotlin.String origin=null - PROPERTY name:testO visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String [operator] declared in ' type=kotlin.String origin=null - $receiver: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null - value: CONST String type=kotlin.String value="O" - host: CONST Null type=kotlin.Nothing? value=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.KProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testO visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - 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=null - receiver: CONST Null type=kotlin.Nothing? value=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.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:testK visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static] - EXPRESSION_BODY - CONST String type=kotlin.String value="K" - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testK visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - 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=null - receiver: CONST Null type=kotlin.Nothing? value=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.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:testOK visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY - other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testOK visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt index 6f806de654d..9678aac78c6 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_RUNTIME class MyClass(val value: String) diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt deleted file mode 100644 index 7e8a32888b1..00000000000 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt +++ /dev/null @@ -1,117 +0,0 @@ -FILE fqName: fileName:/member.kt - CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Delegate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String [operator] declared in .Delegate' - CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate 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 - CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DelegateProvider - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DelegateProvider - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate [operator] declared in .DelegateProvider' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null - value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider 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 - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:testMember$delegate type:.Delegate visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate [operator] declared in .DelegateProvider' type=.Delegate origin=null - $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null - value: CONST String type=kotlin.String value="OK" - thisRef: GET_VAR ': .Host declared in .Host' type=.Host 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.KProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.String - correspondingProperty: PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host' - 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=null - receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null - thisRef: GET_VAR ': .Host declared in .Host.' type=.Host 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.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE - 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 diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.kt b/compiler/testData/ir/irText/declarations/provideDelegate/member.kt index 5a0ffbf7e81..ec396663540 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Delegate(val value: String) { operator fun getValue(thisRef: Any?, property: Any?) = value } diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index 93aaf3265b4..9a42b93b2c5 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -62,7 +62,7 @@ FILE fqName: fileName:/memberExtension.kt $this: GET_VAR ': .Host declared in .Host' type=.Host origin=null $receiver: CONST String type=kotlin.String value="K" host: GET_VAR ': .Host declared in .Host' type=.Host 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.KProperty2<*, *, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + 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.KProperty2.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE $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 FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String) returnType:kotlin.String diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt deleted file mode 100644 index 11bb539222f..00000000000 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt +++ /dev/null @@ -1,96 +0,0 @@ -FILE fqName: fileName:/topLevel.kt - CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Delegate - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String [operator] declared in .Delegate' - CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate 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 - CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider - CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DelegateProvider - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DelegateProvider - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate [operator] declared in .DelegateProvider' - CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null - value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider 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:testTopLevel visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate [operator] declared in .DelegateProvider' type=.Delegate origin=null - $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null - value: CONST String type=kotlin.String value="OK" - thisRef: CONST Null type=kotlin.Nothing? value=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.KProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String - correspondingProperty: PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' - 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=null - thisRef: CONST Null type=kotlin.Nothing? value=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.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt index f1b00f83412..8fe9a7930c0 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Delegate(val value: String) { operator fun getValue(thisRef: Any?, property: Any?) = value }