FIR2IR: Rework DelegatedMemberGenerator

Use scope content instead of manual traversing of declarations
This commit is contained in:
Denis Zharkov
2020-09-24 14:33:49 +03:00
parent e311a60055
commit b241161c35
11 changed files with 687 additions and 548 deletions
@@ -20,44 +20,90 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
RETURN type=kotlin.Nothing from='private final fun <get-j> (): <root>.J declared in <root>.Test'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.<get-j>' type=<root>.Test origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]
FUN FAKE_OVERRIDE name:takeNotNull visibility:public modality:OPEN <> ($this:<root>.J, x:kotlin.String) returnType:kotlin.Unit [fake_override]
FUN DELEGATED_MEMBER name:takeNotNull visibility:public modality:OPEN <> ($this:<root>.Test, x:kotlin.String) returnType:kotlin.Unit
overridden:
public abstract fun takeNotNull (x: kotlin.String): kotlin.Unit declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.Test
VALUE_PARAMETER name:x index:0 type:kotlin.String
FUN FAKE_OVERRIDE name:takeNullable visibility:public modality:OPEN <> ($this:<root>.J, x:kotlin.String?) returnType:kotlin.Unit [fake_override]
BLOCK_BODY
CALL 'public abstract fun takeNotNull (x: kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeNotNull' type=<root>.Test origin=null
x: GET_VAR 'x: kotlin.String declared in <root>.Test.takeNotNull' type=kotlin.String origin=null
FUN DELEGATED_MEMBER name:takeNullable visibility:public modality:OPEN <> ($this:<root>.Test, x:kotlin.String?) returnType:kotlin.Unit
overridden:
public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.Test
VALUE_PARAMETER name:x index:0 type:kotlin.String?
FUN FAKE_OVERRIDE name:takeFlexible visibility:public modality:OPEN <> ($this:<root>.J, x:kotlin.String?) returnType:kotlin.Unit [fake_override]
BLOCK_BODY
CALL 'public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeNullable' type=<root>.Test origin=null
x: GET_VAR 'x: kotlin.String? declared in <root>.Test.takeNullable' type=kotlin.String? origin=null
FUN DELEGATED_MEMBER name:takeFlexible visibility:public modality:OPEN <> ($this:<root>.Test, x:kotlin.String?) returnType:kotlin.Unit
overridden:
public abstract fun takeFlexible (x: kotlin.String?): kotlin.Unit declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.Test
VALUE_PARAMETER name:x index:0 type:kotlin.String?
FUN FAKE_OVERRIDE name:returnNotNull visibility:public modality:OPEN <> ($this:<root>.J) returnType:kotlin.String [fake_override]
BLOCK_BODY
CALL 'public abstract fun takeFlexible (x: kotlin.String?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeFlexible' type=<root>.Test origin=null
x: GET_VAR 'x: kotlin.String? declared in <root>.Test.takeFlexible' type=kotlin.String? origin=null
FUN DELEGATED_MEMBER name:returnNotNull visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
overridden:
public abstract fun returnNotNull (): kotlin.String declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
FUN FAKE_OVERRIDE name:returnNullable visibility:public modality:OPEN <> ($this:<root>.J) returnType:kotlin.String? [fake_override]
$this: VALUE_PARAMETER name:<this> type:<root>.Test
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnNotNull (): kotlin.String declared in <root>.Test'
CALL 'public abstract fun returnNotNull (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnNotNull' type=<root>.Test origin=null
FUN DELEGATED_MEMBER name:returnNullable visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String?
overridden:
public abstract fun returnNullable (): kotlin.String? declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
FUN FAKE_OVERRIDE name:returnsFlexible visibility:public modality:OPEN <> ($this:<root>.J) returnType:kotlin.String? [fake_override]
$this: VALUE_PARAMETER name:<this> type:<root>.Test
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnNullable (): kotlin.String? declared in <root>.Test'
CALL 'public abstract fun returnNullable (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnNullable' type=<root>.Test origin=null
FUN DELEGATED_MEMBER name:returnsFlexible visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String?
overridden:
public abstract fun returnsFlexible (): kotlin.String? declared in <root>.J
$this: VALUE_PARAMETER name:<this> type:<root>.J
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Test
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun returnsFlexible (): kotlin.String? declared in <root>.Test'
CALL 'public abstract fun returnsFlexible (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnsFlexible' type=<root>.Test origin=null
FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test, 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:kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test
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]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.Test'
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>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.equals' type=<root>.Test origin=null
other: GET_VAR 'other: kotlin.Any? declared in <root>.Test.equals' type=kotlin.Any? origin=null
FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.Int
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]
$this: VALUE_PARAMETER name:<this> type:<root>.Test
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Test'
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>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.hashCode' type=<root>.Test origin=null
FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.Test
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Test'
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>.J visibility:local [final]' type=<root>.J origin=null
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.toString' type=<root>.Test origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]