From 940567b8bd72f69b3eb7d54ff780f98a17e6b9fc Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 3 Mar 2020 18:45:45 +0300 Subject: [PATCH] FIR2IR: set enum class modality properly for complex entries case --- .../fir/backend/Fir2IrDeclarationStorage.kt | 23 ++++++++++++++----- .../bridges/substitutionInSuperClass/enum.kt | 1 - .../box/callableReference/property/inEnum.kt | 1 - .../box/defaultArguments/constructor/enum.kt | 1 - .../codegen/box/enum/abstractMethodInEnum.kt | 1 - .../codegen/box/enum/annotatedParameter.kt | 1 - .../codegen/box/enum/annotatedParameter2.kt | 1 - .../constructorWithDefaultArguments.kt | 1 - .../enum/defaultCtor/constructorWithVararg.kt | 1 - ...tryClassConstructorWithDefaultArguments.kt | 1 - .../entryClassConstructorWithVarargs.kt | 1 - ...econdaryConstructorWithDefaultArguments.kt | 1 - .../secondaryConstructorWithVararg.kt | 1 - .../codegen/box/enum/emptyConstructor.kt | 1 - .../testData/codegen/box/enum/enumShort.kt | 1 - compiler/testData/codegen/box/enum/kt20651.kt | 1 - .../testData/codegen/box/enum/kt20651a.kt | 1 - compiler/testData/codegen/box/enum/kt7257.kt | 1 - .../box/enum/kt7257_explicitReceiver.kt | 1 - .../box/enum/kt7257_fullyQualifiedReceiver.kt | 1 - .../codegen/box/enum/kt7257_notInline.kt | 1 - compiler/testData/codegen/box/enum/kt9711.kt | 1 - .../codegen/box/enum/manyDefaultParameters.kt | 1 - .../testData/codegen/box/enum/refToThis.kt | 1 - .../testData/codegen/box/ir/enumClass2.kt | 1 - .../testData/codegen/box/ir/enumClass3.kt | 1 - .../testData/ir/irText/classes/enum.fir.txt | 20 ++++++++-------- .../irText/classes/enumClassModality.fir.txt | 20 ++++++++-------- .../classes/enumWithMultipleCtors.fir.txt | 6 ++--- .../classes/enumWithSecondaryCtor.fir.txt | 12 +++++----- .../enumEntriesWithAnnotations.fir.txt | 4 ++-- .../expressions/enumEntryAsReceiver.fir.txt | 4 ++-- ...umEntryReferenceFromEnumEntryClass.fir.txt | 4 ++-- .../temporaryInEnumEntryInitializer.fir.txt | 4 ++-- .../ir/irText/singletons/enumEntry.fir.txt | 4 ++-- 35 files changed, 56 insertions(+), 70 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 4fa448ad632..d3848f00139 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -5,10 +5,7 @@ package org.jetbrains.kotlin.fir.backend -import org.jetbrains.kotlin.descriptors.DeclarationDescriptor -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibilities -import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter @@ -248,8 +245,22 @@ class Fir2IrDeclarationStorage( val descriptor = WrappedClassDescriptor() val origin = IrDeclarationOrigin.DEFINED - val modality = regularClass.modality ?: Modality.FINAL val visibility = regularClass.visibility + val modality = if (regularClass.classKind == ClassKind.ENUM_CLASS) { + when { + regularClass.declarations.any { it is FirCallableMemberDeclaration<*> && it.modality == Modality.ABSTRACT } -> { + Modality.ABSTRACT + } + regularClass.declarations.any { it is FirEnumEntry && it.initializer != null } -> { + Modality.OPEN + } + else -> { + Modality.FINAL + } + } + } else { + regularClass.modality ?: Modality.FINAL + } val irClass = klass.convertWithOffsets { startOffset, endOffset -> irSymbolTable.declareClass(startOffset, endOffset, origin, descriptor, modality, visibility) { symbol -> IrClassImpl( @@ -259,7 +270,7 @@ class Fir2IrDeclarationStorage( symbol, regularClass.name, klass.classKind, - regularClass.visibility, + visibility, modality, isCompanion = regularClass.isCompanion, isInner = regularClass.isInner, diff --git a/compiler/testData/codegen/box/bridges/substitutionInSuperClass/enum.kt b/compiler/testData/codegen/box/bridges/substitutionInSuperClass/enum.kt index d5b6a242a5f..243498038e6 100644 --- a/compiler/testData/codegen/box/bridges/substitutionInSuperClass/enum.kt +++ b/compiler/testData/codegen/box/bridges/substitutionInSuperClass/enum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { open fun foo(t: T) = "A" } diff --git a/compiler/testData/codegen/box/callableReference/property/inEnum.kt b/compiler/testData/codegen/box/callableReference/property/inEnum.kt index 059d0bfb062..6e1a4f95efa 100644 --- a/compiler/testData/codegen/box/callableReference/property/inEnum.kt +++ b/compiler/testData/codegen/box/callableReference/property/inEnum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty1 diff --git a/compiler/testData/codegen/box/defaultArguments/constructor/enum.kt b/compiler/testData/codegen/box/defaultArguments/constructor/enum.kt index 5ffb959cad7..edc9e061d4c 100644 --- a/compiler/testData/codegen/box/defaultArguments/constructor/enum.kt +++ b/compiler/testData/codegen/box/defaultArguments/constructor/enum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class A(val a: Int = 1) { FIRST(), SECOND(2) diff --git a/compiler/testData/codegen/box/enum/abstractMethodInEnum.kt b/compiler/testData/codegen/box/enum/abstractMethodInEnum.kt index 4e6eb1e29c4..0d3ed6de674 100644 --- a/compiler/testData/codegen/box/enum/abstractMethodInEnum.kt +++ b/compiler/testData/codegen/box/enum/abstractMethodInEnum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class A() { ENTRY(){ override fun t() = "OK"}; diff --git a/compiler/testData/codegen/box/enum/annotatedParameter.kt b/compiler/testData/codegen/box/enum/annotatedParameter.kt index 26cbadb49f9..1bff61e2593 100644 --- a/compiler/testData/codegen/box/enum/annotatedParameter.kt +++ b/compiler/testData/codegen/box/enum/annotatedParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: Foo.java diff --git a/compiler/testData/codegen/box/enum/annotatedParameter2.kt b/compiler/testData/codegen/box/enum/annotatedParameter2.kt index 126b1e715f1..4d49865ade5 100644 --- a/compiler/testData/codegen/box/enum/annotatedParameter2.kt +++ b/compiler/testData/codegen/box/enum/annotatedParameter2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: Foo.java diff --git a/compiler/testData/codegen/box/enum/defaultCtor/constructorWithDefaultArguments.kt b/compiler/testData/codegen/box/enum/defaultCtor/constructorWithDefaultArguments.kt index ae1de9763d1..fcdaf5b62ae 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/constructorWithDefaultArguments.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/constructorWithDefaultArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(val str: String = "OK") { OK } diff --git a/compiler/testData/codegen/box/enum/defaultCtor/constructorWithVararg.kt b/compiler/testData/codegen/box/enum/defaultCtor/constructorWithVararg.kt index 496ef0089ab..f293632dffa 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/constructorWithVararg.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/constructorWithVararg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(vararg xs: Int) { OK; val values = xs diff --git a/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithDefaultArguments.kt b/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithDefaultArguments.kt index e0c22208b0d..dfe8da0b5ca 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithDefaultArguments.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithDefaultArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(val str: String = "OK") { OK { fun foo() {} diff --git a/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithVarargs.kt b/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithVarargs.kt index 0a7e69925e2..b5d7511a0b0 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithVarargs.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/entryClassConstructorWithVarargs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithDefaultArguments.kt b/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithDefaultArguments.kt index d0a9aeb0fba..fb08b98daab 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithDefaultArguments.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithDefaultArguments.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(val x: Int, val str: String) { OK; constructor(x: Int = 0) : this(x, "OK") diff --git a/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithVararg.kt b/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithVararg.kt index 23b7e9cbf70..15c5ad34e9c 100644 --- a/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithVararg.kt +++ b/compiler/testData/codegen/box/enum/defaultCtor/secondaryConstructorWithVararg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(val x: Int, val str: String) { OK; constructor(vararg xs: Int) : this(xs.size + 42, "OK") diff --git a/compiler/testData/codegen/box/enum/emptyConstructor.kt b/compiler/testData/codegen/box/enum/emptyConstructor.kt index caa71c8c1e0..c82a4ac41c3 100644 --- a/compiler/testData/codegen/box/enum/emptyConstructor.kt +++ b/compiler/testData/codegen/box/enum/emptyConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package test enum class My(val s: String) { diff --git a/compiler/testData/codegen/box/enum/enumShort.kt b/compiler/testData/codegen/box/enum/enumShort.kt index e5b5b891892..78935006d2b 100644 --- a/compiler/testData/codegen/box/enum/enumShort.kt +++ b/compiler/testData/codegen/box/enum/enumShort.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Color(val rgb: Int) { RED(0xff0000), GREEN(0x00ff00), diff --git a/compiler/testData/codegen/box/enum/kt20651.kt b/compiler/testData/codegen/box/enum/kt20651.kt index 8542e35be26..8845e4c6d48 100644 --- a/compiler/testData/codegen/box/enum/kt20651.kt +++ b/compiler/testData/codegen/box/enum/kt20651.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test(val x: String, val closure1: () -> String) { FOO("O", { FOO.x }) { override val y: String = "K" diff --git a/compiler/testData/codegen/box/enum/kt20651a.kt b/compiler/testData/codegen/box/enum/kt20651a.kt index bf89285e2f9..4bdecd58654 100644 --- a/compiler/testData/codegen/box/enum/kt20651a.kt +++ b/compiler/testData/codegen/box/enum/kt20651a.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Foo( val x: String, val callback: () -> String diff --git a/compiler/testData/codegen/box/enum/kt7257.kt b/compiler/testData/codegen/box/enum/kt7257.kt index 59051e33d68..78dca7e9610 100644 --- a/compiler/testData/codegen/box/enum/kt7257.kt +++ b/compiler/testData/codegen/box/enum/kt7257.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class X { B { val value2 = "K" diff --git a/compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt b/compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt index 2721134ac12..44c3183a50a 100644 --- a/compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt +++ b/compiler/testData/codegen/box/enum/kt7257_explicitReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class X { B { override val value2 = "K" diff --git a/compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt b/compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt index 242222f9683..384e2daa331 100644 --- a/compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt +++ b/compiler/testData/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class X { B { override val value2 = "K" diff --git a/compiler/testData/codegen/box/enum/kt7257_notInline.kt b/compiler/testData/codegen/box/enum/kt7257_notInline.kt index 0ca1f9ab3ba..3851efb5669 100644 --- a/compiler/testData/codegen/box/enum/kt7257_notInline.kt +++ b/compiler/testData/codegen/box/enum/kt7257_notInline.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun T.letNoInline(fn: (T) -> R) = fn(this) diff --git a/compiler/testData/codegen/box/enum/kt9711.kt b/compiler/testData/codegen/box/enum/kt9711.kt index 406f19d3497..096316ed24b 100644 --- a/compiler/testData/codegen/box/enum/kt9711.kt +++ b/compiler/testData/codegen/box/enum/kt9711.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class X { B { diff --git a/compiler/testData/codegen/box/enum/manyDefaultParameters.kt b/compiler/testData/codegen/box/enum/manyDefaultParameters.kt index 217b67ad2eb..a094da96f27 100644 --- a/compiler/testData/codegen/box/enum/manyDefaultParameters.kt +++ b/compiler/testData/codegen/box/enum/manyDefaultParameters.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class ClassTemplate( // var bug: Int = 1, var code: Int, diff --git a/compiler/testData/codegen/box/enum/refToThis.kt b/compiler/testData/codegen/box/enum/refToThis.kt index ea25b3c7d0f..77da3bf2133 100644 --- a/compiler/testData/codegen/box/enum/refToThis.kt +++ b/compiler/testData/codegen/box/enum/refToThis.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Enum { ENUM_VALUE { override fun test() = ENUM_VALUE diff --git a/compiler/testData/codegen/box/ir/enumClass2.kt b/compiler/testData/codegen/box/ir/enumClass2.kt index de3676ae8bd..077bc5d5ea3 100644 --- a/compiler/testData/codegen/box/ir/enumClass2.kt +++ b/compiler/testData/codegen/box/ir/enumClass2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ir/enumClass3.kt b/compiler/testData/codegen/box/ir/enumClass3.kt index 0dc76b81e82..7f66bbaf040 100644 --- a/compiler/testData/codegen/box/ir/enumClass3.kt +++ b/compiler/testData/codegen/box/ir/enumClass3.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt index a2126b0005c..03e2e23098a 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -53,14 +53,14 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestEnum1 - CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>] + CLASS ENUM_CLASS name:TestEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -143,13 +143,13 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestEnum2 - CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum3>] + CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3 CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum3 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' ENUM_ENTRY name:TEST init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum3.TEST' @@ -207,14 +207,14 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestEnum3 - CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum4>] + CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum4 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestEnum4>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -313,7 +313,7 @@ FILE fqName: fileName:/enum.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestEnum4 - CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>] + CLASS ENUM_CLASS name:TestEnum5 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum5>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int @@ -322,7 +322,7 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum5 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum5>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -407,7 +407,7 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 - CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>] + CLASS ENUM_CLASS name:TestEnum6 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum6>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum6 CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestEnum6 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int @@ -415,7 +415,7 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum6 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum6>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt index ffe9d370e9a..0802a157925 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt @@ -50,14 +50,14 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestFinalEnum1 - CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>] + CLASS ENUM_CLASS name:TestFinalEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestFinalEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestFinalEnum2>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.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: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestFinalEnum3 - CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>] + CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestOpenEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestOpenEnum1.X1' @@ -236,13 +236,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestOpenEnum1 - CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>] + CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestOpenEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestOpenEnum2.X1' @@ -299,13 +299,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.TestOpenEnum2 - CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] + CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestAbstractEnum1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestAbstractEnum1.X1' @@ -378,13 +378,13 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>] + CLASS ENUM_CLASS name:TestAbstractEnum2 modality:OPEN visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestAbstractEnum2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:OPEN visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>]' ENUM_ENTRY name:X1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestAbstractEnum2.X1' diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt index d1fb234424e..83677ee9c9d 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt @@ -1,5 +1,5 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt - CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>] + CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A ENUM_ENTRY name:X init: EXPRESSION_BODY @@ -85,7 +85,7 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt value: GET_VAR 'arg: kotlin.String declared in .A.' type=kotlin.String origin=null ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .A - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' CONSTRUCTOR visibility:private <> () returnType:.A BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null @@ -96,7 +96,7 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt value: CONST String type=kotlin.String value="empty" ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .A - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.A VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt index 637a10388c8..7d68ddeec62 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt @@ -1,12 +1,12 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt - CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>] + CLASS ENUM_CLASS name:Test0 modality:OPEN visibility:public superTypes:[kotlin.Enum<.Test0>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .Test0 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test0>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:OPEN visibility:public superTypes:[kotlin.Enum<.Test0>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -72,14 +72,14 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.Test0 - CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>] + CLASS ENUM_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.Test1>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .Test1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test1>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:OPEN visibility:public superTypes:[kotlin.Enum<.Test1>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY @@ -155,14 +155,14 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public final fun (): kotlin.Int declared in kotlin.Enum $this: VALUE_PARAMETER name: type:.Test1 - CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test2>] + CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .Test2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test2>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.Test2>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt index a6967df03dd..c78d26fe8f7 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt @@ -27,13 +27,13 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>] + CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .TestEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.TestEnum>]' ENUM_ENTRY name:ENTRY1 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum.ENTRY1' diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 26c81009444..3e319ab9c28 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -1,11 +1,11 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt - CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum<.X>] + CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X CONSTRUCTOR visibility:private <> () returnType:.X [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .X - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum<.X>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Enum<.X>]' ENUM_ENTRY name:B init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .X.B' diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 0c73af2b664..b18f58de8f1 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -1,11 +1,11 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt - CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>] + CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .MyEnum - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:OPEN visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:Z init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z' diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index 9b6254ac366..d95dfe95d67 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -8,14 +8,14 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:private [final,static]' type=kotlin.Any? origin=null - CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>] + CLASS ENUM_CLASS name:En modality:OPEN visibility:public superTypes:[kotlin.Enum<.En>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:.En [primary] VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .En - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<.En>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:OPEN visibility:public superTypes:[kotlin.Enum<.En>]' PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index 8157d1bb8ce..3a4d0d41259 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -1,11 +1,11 @@ FILE fqName: fileName:/enumEntry.kt - CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<.Z>] + CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z CONSTRUCTOR visibility:private <> () returnType:.Z [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .Z - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<.Z>]' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' ENUM_ENTRY name:ENTRY init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.ENTRY'