Fir2Ir: more precise calculation of enum class modality
Use the same condition as in the already existing `createIrEnumEntry` function (and as in psi2ir): enum class should be final unless there's an enum entry with any declaration other than its constructor. #KT-57216
This commit is contained in:
committed by
Space Team
parent
2cc3b542fd
commit
68b94b07b8
+6
-6
@@ -61,14 +61,14 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
CLASS ENUM_CLASS name:TestEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum2>]
|
||||
CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum2>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum2
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestEnum2 [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>.TestEnum2
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum2>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum2>]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -470,7 +470,7 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<E of kotlin.Enum>
|
||||
CLASS ENUM_CLASS name:TestEnum5 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum5>]
|
||||
CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum5>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum5
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestEnum5 [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
@@ -479,7 +479,7 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
|
||||
<E>: <root>.TestEnum5
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum5>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum5>]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -554,7 +554,7 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CLASS ENUM_CLASS name:TestEnum6 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]
|
||||
CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum6
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.TestEnum6 [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
@@ -562,7 +562,7 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
|
||||
<E>: <root>.TestEnum6
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
Reference in New Issue
Block a user