FIR2IR: set enum class modality properly for complex entries case

This commit is contained in:
Mikhail Glukhikh
2020-03-03 18:45:45 +03:00
parent 3ffe1a1876
commit 940567b8bd
35 changed files with 56 additions and 70 deletions
+10 -10
View File
@@ -50,14 +50,14 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.TestFinalEnum1
CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum2>]
CLASS ENUM_CLASS name:TestFinalEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum2>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum2
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestFinalEnum2 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.TestFinalEnum2
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum2>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum2>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
@@ -174,13 +174,13 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.TestFinalEnum3
CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum1>]
CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum1>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum1 [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.TestOpenEnum1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum1>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum1>]'
ENUM_ENTRY name:X1
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1.X1'
@@ -236,13 +236,13 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum1
CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum2>]
CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum2>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum2
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum2 [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.TestOpenEnum2
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum2>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum2>]'
ENUM_ENTRY name:X1
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2.X1'
@@ -299,13 +299,13 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum2
CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestAbstractEnum1>]
CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<<root>.TestAbstractEnum1>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum1 [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.TestAbstractEnum1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestAbstractEnum1>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<<root>.TestAbstractEnum1>]'
ENUM_ENTRY name:X1
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1.X1'
@@ -378,13 +378,13 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]
CLASS ENUM_CLASS name:TestAbstractEnum2 modality:OPEN visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum2
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum2 [primary]
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.TestAbstractEnum2
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:OPEN visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]'
ENUM_ENTRY name:X1
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2.X1'