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
@@ -71,16 +71,19 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
PROPERTY name:z1 visibility:public modality:ABSTRACT [val]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-z1> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-z1> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int
correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val]
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
PROPERTY name:z2 visibility:public modality:ABSTRACT [var]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int
correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var]
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, <set-?>:kotlin.Int) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, $receiver:kotlin.Byte, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var]
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
@@ -138,22 +141,25 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
receiver: GET_VAR '<this>: <root>.otherImpl.<no name provided> declared in <root>.otherImpl.<no name provided>.<set-y>' type=<root>.otherImpl.<no name provided> origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.otherImpl.<no name provided>.<set-y>' type=kotlin.Int origin=null
PROPERTY name:z1 visibility:public modality:FINAL [val]
FUN name:<get-z1> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>) returnType:kotlin.Int
FUN name:<get-z1> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>, $receiver:kotlin.Byte) returnType:kotlin.Int
correspondingProperty: PROPERTY name:z1 visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.otherImpl.<no name provided>
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-z1> (): kotlin.Int declared in <root>.otherImpl.<no name provided>'
CONST Int type=kotlin.Int value=1
PROPERTY name:z2 visibility:public modality:FINAL [var]
FUN name:<get-z2> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>) returnType:kotlin.Int
FUN name:<get-z2> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>, $receiver:kotlin.Byte) returnType:kotlin.Int
correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.otherImpl.<no name provided>
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-z2> (): kotlin.Int declared in <root>.otherImpl.<no name provided>'
CONST Int type=kotlin.Int value=2
FUN name:<set-z2> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>, value:kotlin.Int) returnType:kotlin.Unit
FUN name:<set-z2> visibility:public modality:FINAL <> ($this:<root>.otherImpl.<no name provided>, $receiver:kotlin.Byte, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.otherImpl.<no name provided>
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Byte
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.otherImpl.<no name provided>' type=<root>.otherImpl.<no name provided> origin=null