FIR: Refine delegated members introduced to use-site scope

- Do not add hashCode/equals/toString
- Do not add privates and ones that are already declared
This commit is contained in:
Denis Zharkov
2020-10-27 10:50:07 +03:00
parent 2105a041a5
commit 2589de6c49
15 changed files with 212 additions and 410 deletions
@@ -63,35 +63,6 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.foo' type=<root>.Test1<E of <root>.Test1> origin=null
a: GET_VAR 'a: E of <root>.Test1 declared in <root>.Test1.foo' type=E of <root>.Test1 origin=null
b: GET_VAR 'b: B of <root>.Test1.foo declared in <root>.Test1.foo' type=B of <root>.Test1.foo origin=null
FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.Test1'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.equals' type=<root>.Test1<E of <root>.Test1> origin=null
other: GET_VAR 'other: kotlin.Any? declared in <root>.Test1.equals' type=kotlin.Any? origin=null
FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>) returnType:kotlin.Int
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Test1'
CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.hashCode' type=<root>.Test1<E of <root>.Test1> origin=null
FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test1<E of <root>.Test1>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Test1'
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.toString' type=<root>.Test1<E of <root>.Test1> origin=null
PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-id> visibility:public modality:OPEN <C> ($this:<root>.Test1<E of <root>.Test1>, $receiver:C of <root>.Test1.<get-id>) returnType:kotlin.collections.Map<E of <root>.Test1, C of <root>.Test1.<get-id>>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
@@ -138,6 +109,19 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
$receiver: GET_VAR '<this>: kotlin.collections.List<D of <root>.Test1.<get-x>> declared in <root>.Test1.<set-x>' type=kotlin.collections.List<D of <root>.Test1.<get-x>> origin=null
<set-?>: GET_VAR '<set-?>: D of <root>.Test1.<set-x>? declared in <root>.Test1.<set-x>' type=D of <root>.Test1.<set-x>? origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<E of <root>.Test1> visibility:local [final]
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:<this> 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:<this> 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:<this> type:kotlin.Any
CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[<root>.IBase<kotlin.String>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2
CONSTRUCTOR visibility:public <> (j:<root>.IBase<kotlin.String>) returnType:<root>.Test2 [primary]
@@ -181,35 +165,6 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.foo' type=<root>.Test2 origin=null
a: GET_VAR 'a: kotlin.String declared in <root>.Test2.foo' type=kotlin.String origin=null
b: GET_VAR 'b: B of <root>.Test2.foo declared in <root>.Test2.foo' type=B of <root>.Test2.foo origin=null
FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test2, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.Test2'
CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.equals' type=<root>.Test2 origin=null
other: GET_VAR 'other: kotlin.Any? declared in <root>.Test2.equals' type=kotlin.Any? origin=null
FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Int
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Test2'
CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.hashCode' type=<root>.Test2 origin=null
FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Test2'
CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.toString' type=<root>.Test2 origin=null
PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-id> visibility:public modality:OPEN <C> ($this:<root>.Test2, $receiver:C of <root>.Test2.<get-id>) returnType:kotlin.collections.Map<kotlin.String, C of <root>.Test2.<get-id>>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
@@ -256,3 +211,16 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
$receiver: GET_VAR '<this>: kotlin.collections.List<D of <root>.Test2.<get-x>> declared in <root>.Test2.<set-x>' type=kotlin.collections.List<D of <root>.Test2.<get-x>> origin=null
<set-?>: GET_VAR '<set-?>: D of <root>.Test2.<set-x>? declared in <root>.Test2.<set-x>' type=D of <root>.Test2.<set-x>? origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]
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:<this> 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:<this> 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:<this> type:kotlin.Any