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:
Alexander Udalov
2023-03-15 00:11:36 +01:00
committed by Space Team
parent 2cc3b542fd
commit 68b94b07b8
17 changed files with 43 additions and 45 deletions
@@ -38,7 +38,7 @@ FILE fqName:<root> fileName:/lambdaInEnumEntryConstructorCall.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ENUM_CLASS name:ConfigurationParameter modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.ConfigurationParameter>]
CLASS ENUM_CLASS name:ConfigurationParameter modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.ConfigurationParameter>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.ConfigurationParameter
ENUM_ENTRY name:BASE_URL
init: EXPRESSION_BODY
@@ -65,7 +65,7 @@ FILE fqName:<root> fileName:/lambdaInEnumEntryConstructorCall.kt
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <root>.ConfigurationParameter
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:ConfigurationParameter modality:OPEN visibility:public superTypes:[kotlin.Enum<<root>.ConfigurationParameter>]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:ConfigurationParameter modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.ConfigurationParameter>]'
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.ConfigurationParameter>
SYNTHETIC_BODY kind=ENUM_VALUES
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.ConfigurationParameter