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
@@ -1,12 +1,12 @@
|
||||
FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
|
||||
CLASS ENUM_CLASS name:Test0 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.Test0>]
|
||||
CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test0>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test0
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.Test0 [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>.Test0
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.Test0>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test0>]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -74,14 +74,14 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.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:Test1 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.Test1>]
|
||||
CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test1>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test1
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.Test1 [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>.Test1
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.Test1>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test1>]'
|
||||
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