FIR2IR: set 'SetField' type to Unit, convert explicit 'this' references

This commit is contained in:
Mikhail Glukhikh
2019-08-26 19:32:21 +03:00
parent 6604539154
commit da22898a19
53 changed files with 171 additions and 262 deletions
@@ -30,10 +30,11 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
@@ -45,20 +46,22 @@ FILE fqName:<root> fileName:/objectReference.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Z.Nested) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z.Nested
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
@@ -82,10 +85,11 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
@@ -108,20 +112,22 @@ FILE fqName:<root> fileName:/objectReference.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Z.anObject.<no name provided>) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z.anObject.<no name provided>
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
@@ -149,10 +155,11 @@ FILE fqName:<root> fileName:/objectReference.kt
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.Z) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Int origin=null
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null
receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z