FIR2IR: cache enum entry classes properly

This commit is contained in:
Mikhail Glukhikh
2020-03-03 17:51:18 +03:00
parent 03eab2ec6c
commit 5af3d92271
10 changed files with 64 additions and 71 deletions
@@ -9,7 +9,7 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
ENUM_ENTRY name:Z
class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[<root>.MyEnum]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<no name provided> [primary]
CONSTRUCTOR visibility:private <> () returnType:<root>.MyEnum.Z [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[<root>.MyEnum]'
@@ -39,10 +39,10 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
PROPERTY name:aLambda visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]
EXPRESSION_BODY
@@ -50,10 +50,10 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aLambda> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Function0<kotlin.Unit>
correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
@@ -74,18 +74,18 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
FUN name:test visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z.anObject.<no name provided>) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z.anObject.<no name provided>
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <uninitialized parent>.<no name provided> declared in <no parent>.<no name provided>' type=<uninitialized parent>.<no name provided> origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum.Z.anObject.<no name provided>' type=<root>.MyEnum.Z.anObject.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:<root>.MyEnum.Z.anObject.<no name provided>
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val]