FIR2IR: declare receivers for all accessors of extension properties

Before this commit, extension receivers were declared only for
properties with container source, which is strange & inconsistent.
Now we declare accessor extension receiver iff corresponding property
has extension receiver.
This commit is contained in:
Mikhail Glukhikh
2020-02-25 11:57:16 +03:00
parent 8c155578f7
commit d1fac6dce1
32 changed files with 158 additions and 124 deletions
@@ -31,12 +31,14 @@ FILE fqName:<root> fileName:/genericClassInDifferentModule_m1.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Base<T of <root>.Base>
VALUE_PARAMETER name:<set-?> index:0 type:T of <root>.Base
PROPERTY name:exn visibility:public modality:ABSTRACT [var]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-exn> visibility:public modality:ABSTRACT <> ($this:<root>.Base<T of <root>.Base>) returnType:T of <root>.Base
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-exn> visibility:public modality:ABSTRACT <> ($this:<root>.Base<T of <root>.Base>, $receiver:Z of <uninitialized parent>) returnType:T of <root>.Base
correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var]
$this: VALUE_PARAMETER name:<this> type:<root>.Base<T of <root>.Base>
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-exn> visibility:public modality:ABSTRACT <> ($this:<root>.Base<T of <root>.Base>, <set-?>:T of <root>.Base) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:Z of <uninitialized parent>
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-exn> visibility:public modality:ABSTRACT <> ($this:<root>.Base<T of <root>.Base>, $receiver:Z of <uninitialized parent>, <set-?>:T of <root>.Base) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var]
$this: VALUE_PARAMETER name:<this> type:<root>.Base<T of <root>.Base>
$receiver: VALUE_PARAMETER name:<this> type:Z of <uninitialized parent>
VALUE_PARAMETER name:<set-?> index:0 type:T of <root>.Base
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -37,16 +37,18 @@ FILE fqName:<root> fileName:/genericClassInDifferentModule_m2.kt
receiver: GET_VAR '<this>: <root>.Derived1<T of <root>.Derived1> declared in <root>.Derived1.<set-bar>' type=<root>.Derived1<T of <root>.Derived1> origin=null
value: GET_VAR '<set-?>: T of <root>.Derived1 declared in <root>.Derived1.<set-bar>' type=T of <root>.Derived1 origin=null
PROPERTY name:exn visibility:public modality:FINAL [var]
FUN name:<get-exn> visibility:public modality:FINAL <> ($this:<root>.Derived1<T of <root>.Derived1>) returnType:T of <root>.Derived1
FUN name:<get-exn> visibility:public modality:FINAL <> ($this:<root>.Derived1<T of <root>.Derived1>, $receiver:Z of <uninitialized parent>) returnType:T of <root>.Derived1
correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.Derived1<T of <root>.Derived1>
$receiver: VALUE_PARAMETER name:<this> type:Z of <uninitialized parent>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-exn> (): T of <root>.Derived1 declared in <root>.Derived1'
CALL 'public final fun <get-x> (): T of <root>.Derived1 declared in <root>.Base' type=T of <root>.Derived1 origin=null
$this: GET_VAR '<this>: <root>.Derived1<T of <root>.Derived1> declared in <root>.Derived1.<get-exn>' type=<root>.Derived1<T of <root>.Derived1> origin=null
FUN name:<set-exn> visibility:public modality:FINAL <> ($this:<root>.Derived1<T of <root>.Derived1>, value:T of <root>.Derived1) returnType:kotlin.Unit
FUN name:<set-exn> visibility:public modality:FINAL <> ($this:<root>.Derived1<T of <root>.Derived1>, $receiver:Z of <uninitialized parent>, value:T of <root>.Derived1) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.Derived1<T of <root>.Derived1>
$receiver: VALUE_PARAMETER name:<this> type:Z of <uninitialized parent>
VALUE_PARAMETER name:value index:0 type:T of <root>.Derived1
BLOCK_BODY
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
@@ -1,7 +1,8 @@
FILE fqName:<root> fileName:/jdkClassSyntheticProperty.kt
PROPERTY name:test visibility:public modality:FINAL [val]
FUN name:<get-test> visibility:public modality:FINAL <> () returnType:kotlin.Array<out java.lang.reflect.Field?>?
FUN name:<get-test> visibility:public modality:FINAL <> ($receiver:java.lang.Class<*>) returnType:kotlin.Array<out java.lang.reflect.Field?>?
correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val]
$receiver: VALUE_PARAMETER name:<this> type:java.lang.Class<*>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test> (): kotlin.Array<out java.lang.reflect.Field?>? declared in <root>'
CALL 'public open fun <get-declaredFields> (): kotlin.Array<out java.lang.reflect.Field?>? declared in java.lang.Class' type=kotlin.Array<out java.lang.reflect.Field?>? origin=null