[FIR2IR] Move delegating constructor call to body start

This commit is contained in:
Mikhail Glukhikh
2020-03-16 16:26:15 +03:00
parent 10c2aa1657
commit 51c83e5f62
9 changed files with 32 additions and 33 deletions
@@ -83,7 +83,7 @@ FILE fqName:<root> fileName:/argumentReorderingInDelegatingConstructorCall.kt
VALUE_PARAMETER name:xx index:0 type:kotlin.Int
VALUE_PARAMETER name:yy index:1 type:kotlin.Int
BLOCK_BODY
ERROR_CALL 'Cannot find delegated constructor call' type=<root>.Test2
ERROR_CALL 'Cannot find delegated constructor call' type=kotlin.Any
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[<root>.Base]'
CONSTRUCTOR visibility:public <> (xxx:kotlin.Int, yyy:kotlin.Int, a:kotlin.Any) returnType:<root>.Test2
VALUE_PARAMETER name:xxx index:0 type:kotlin.Int
@@ -80,32 +80,32 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
CONSTRUCTOR visibility:private <> (arg:kotlin.String) returnType:<root>.A
VALUE_PARAMETER name:arg index:0 type:kotlin.String
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
value: GET_VAR 'arg: kotlin.String declared in <root>.A.<init>' type=kotlin.String origin=null
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.A
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.A>]'
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
value: GET_VAR 'arg: kotlin.String declared in <root>.A.<init>' type=kotlin.String origin=null
CONSTRUCTOR visibility:private <> () returnType:<root>.A
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.A
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.A>]'
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
value: CONST String type=kotlin.String value="default"
CALL 'public final fun <set-prop3> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
<set-?>: CONST String type=kotlin.String value="empty"
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.A
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.A>]'
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.A
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public final fun <set-prop3> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
<set-?>: CONST String type=kotlin.String value="int"
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
arg: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'x: kotlin.Int declared in <root>.A.<init>' type=kotlin.Int origin=null
CALL 'public final fun <set-prop3> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
<set-?>: CONST String type=kotlin.String value="int"
FUN name:f visibility:public modality:OPEN <> ($this:<root>.A) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
+2 -2
View File
@@ -214,11 +214,11 @@ FILE fqName:<root> fileName:/initVar.kt
value: GET_VAR 'value: kotlin.Int declared in <root>.TestInitVarWithCustomSetterInCtor.<set-x>' type=kotlin.Int origin=null
CONSTRUCTOR visibility:public <> () returnType:<root>.TestInitVarWithCustomSetterInCtor
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetterInCtor modality:FINAL visibility:public superTypes:[kotlin.Any]'
CALL 'public final fun <set-x> (value: kotlin.Int): kotlin.Unit declared in <root>.TestInitVarWithCustomSetterInCtor' type=kotlin.Unit origin=EQ
$this: GET_VAR '<this>: <root>.TestInitVarWithCustomSetterInCtor declared in <root>.TestInitVarWithCustomSetterInCtor' type=<root>.TestInitVarWithCustomSetterInCtor origin=null
value: CONST Int type=kotlin.Int value=42
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetterInCtor modality:FINAL visibility:public superTypes:[kotlin.Any]'
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