From 3ffe1a1876133b3fcedbf61d458065c60840e821 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 3 Mar 2020 18:03:27 +0300 Subject: [PATCH] FIR2IR: create IrEnumConstructorCall even in complex entries --- .../kotlin/fir/backend/Fir2IrVisitor.kt | 12 ++++++++--- .../testData/ir/irText/classes/enum.fir.txt | 20 +++++++++++++++++++ .../irText/classes/enumClassModality.fir.txt | 10 ++++++++++ .../classes/enumWithMultipleCtors.fir.txt | 6 ++++++ .../classes/enumWithSecondaryCtor.fir.txt | 10 ++++++++++ .../enumEntriesWithAnnotations.fir.txt | 4 ++++ .../expressions/enumEntryAsReceiver.fir.txt | 2 ++ ...umEntryReferenceFromEnumEntryClass.fir.txt | 2 ++ .../temporaryInEnumEntryInitializer.fir.txt | 2 ++ .../ir/irText/singletons/enumEntry.fir.txt | 2 ++ 10 files changed, 67 insertions(+), 3 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 00b2827c0a4..2b9e29cc3a2 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -115,10 +115,16 @@ class Fir2IrVisitor( override fun visitEnumEntry(enumEntry: FirEnumEntry, data: Any?): IrElement { val irEnumEntry = declarationStorage.getIrEnumEntry(enumEntry, irParent = conversionScope.lastClass()) - conversionScope.withParent(irEnumEntry.correspondingClass) { - this?.setClassContent(enumEntry.initializer as FirAnonymousObject) + val correspondingClass = irEnumEntry.correspondingClass ?: return irEnumEntry + conversionScope.withParent(correspondingClass) { + setClassContent(enumEntry.initializer as FirAnonymousObject) + irEnumEntry.initializerExpression = IrExpressionBodyImpl( + IrEnumConstructorCallImpl( + startOffset, endOffset, enumEntry.returnTypeRef.toIrType(), + correspondingClass.constructors.first().symbol + ) + ) } - //irEnumEntry.initializerExpression = IrEnumConstructorCallImpl() return irEnumEntry } diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt index b5e67b7fc02..a2126b0005c 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -73,6 +73,8 @@ FILE fqName: fileName:/enum.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum2 declared in .TestEnum2.' type=.TestEnum2 origin=null ENUM_ENTRY name:TEST1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum2.TEST1' class: CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST1 CONSTRUCTOR visibility:private <> () returnType:.TestEnum2.TEST1 [primary] @@ -81,6 +83,8 @@ FILE fqName: fileName:/enum.kt x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum2]' ENUM_ENTRY name:TEST2 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum2.TEST2' class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST2 CONSTRUCTOR visibility:private <> () returnType:.TestEnum2.TEST2 [primary] @@ -89,6 +93,8 @@ FILE fqName: fileName:/enum.kt x: CONST Int type=kotlin.Int value=2 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum2]' ENUM_ENTRY name:TEST3 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum2.TEST3' class: CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[.TestEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST3 CONSTRUCTOR visibility:private <> () returnType:.TestEnum2.TEST3 [primary] @@ -145,6 +151,8 @@ FILE fqName: fileName:/enum.kt : .TestEnum3 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum3>]' ENUM_ENTRY name:TEST + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum3.TEST' class: CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[.TestEnum3] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3.TEST CONSTRUCTOR visibility:private <> () returnType:.TestEnum3.TEST [primary] @@ -219,6 +227,8 @@ FILE fqName: fileName:/enum.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum4 declared in .TestEnum4.' type=.TestEnum4 origin=null ENUM_ENTRY name:TEST1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum4.TEST1' class: CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum4] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST1 CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST1 [primary] @@ -232,6 +242,8 @@ FILE fqName: fileName:/enum.kt CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_ENUM 'ENUM_ENTRY name:TEST1' type=.TestEnum4 ENUM_ENTRY name:TEST2 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum4.TEST2' class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum4] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST2 CONSTRUCTOR visibility:private <> () returnType:.TestEnum4.TEST2 [primary] @@ -323,6 +335,8 @@ FILE fqName: fileName:/enum.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum5 declared in .TestEnum5.' type=.TestEnum5 origin=null ENUM_ENTRY name:TEST1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum5.TEST1' class: CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum5] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST1 CONSTRUCTOR visibility:private <> () returnType:.TestEnum5.TEST1 [primary] @@ -330,6 +344,8 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum5]' ENUM_ENTRY name:TEST2 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum5.TEST2' class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum5] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST2 CONSTRUCTOR visibility:private <> () returnType:.TestEnum5.TEST2 [primary] @@ -337,6 +353,8 @@ FILE fqName: fileName:/enum.kt ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum5]' ENUM_ENTRY name:TEST3 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum5.TEST3' class: CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[.TestEnum5] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST3 CONSTRUCTOR visibility:private <> () returnType:.TestEnum5.TEST3 [primary] @@ -421,6 +439,8 @@ FILE fqName: fileName:/enum.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestEnum6 declared in .TestEnum6.' type=.TestEnum6 origin=null ENUM_ENTRY name:TEST + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum6.TEST' class: CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[.TestEnum6] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum6.TEST CONSTRUCTOR visibility:private <> () returnType:.TestEnum6.TEST [primary] diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt index 10189c0d69d..ffe9d370e9a 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt @@ -70,6 +70,8 @@ FILE fqName: fileName:/enumClassModality.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .TestFinalEnum2 declared in .TestFinalEnum2.' type=.TestFinalEnum2 origin=null ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestFinalEnum2.X1' class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestFinalEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2.X1 CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum2.X1 [primary] @@ -180,6 +182,8 @@ FILE fqName: fileName:/enumClassModality.kt : .TestOpenEnum1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum1>]' ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestOpenEnum1.X1' class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum1] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1.X1 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1.X1 [primary] @@ -240,6 +244,8 @@ FILE fqName: fileName:/enumClassModality.kt : .TestOpenEnum2 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestOpenEnum2>]' ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestOpenEnum2.X1' class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestOpenEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2.X1 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2.X1 [primary] @@ -301,6 +307,8 @@ FILE fqName: fileName:/enumClassModality.kt : .TestAbstractEnum1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestAbstractEnum1>]' ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestAbstractEnum1.X1' class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum1] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1.X1 [primary] @@ -378,6 +386,8 @@ FILE fqName: fileName:/enumClassModality.kt : .TestAbstractEnum2 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[.IFoo; kotlin.Enum<.TestAbstractEnum2>]' ENUM_ENTRY name:X1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestAbstractEnum2.X1' class: CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestAbstractEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2.X1 [primary] diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt index 34649843d47..d1fb234424e 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt @@ -2,6 +2,8 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt CLASS ENUM_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Enum<.A>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A ENUM_ENTRY name:X + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .A.X' class: CLASS ENUM_ENTRY name:X modality:FINAL visibility:private superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.X CONSTRUCTOR visibility:private <> () returnType:.A.X [primary] @@ -10,6 +12,8 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt arg: CONST String type=kotlin.String value="asd" INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X modality:FINAL visibility:private superTypes:[.A]' ENUM_ENTRY name:Y + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .A.Y' class: CLASS ENUM_ENTRY name:Y modality:FINAL visibility:private superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.Y CONSTRUCTOR visibility:private <> () returnType:.A.Y [primary] @@ -25,6 +29,8 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt $this: GET_VAR ': .A.Y declared in .A.Y.f' type=.A.Y origin=null other: CONST String type=kotlin.String value="#Y" ENUM_ENTRY name:Z + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .A.Z' class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.A] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.Z CONSTRUCTOR visibility:private <> () returnType:.A.Z [primary] diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt index c469e610d21..637a10388c8 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt @@ -19,6 +19,8 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test0 declared in .Test0.' type=.Test0 origin=null ENUM_ENTRY name:ZERO + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Test0.ZERO' class: CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test0] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0.ZERO CONSTRUCTOR visibility:private <> () returnType:.Test0.ZERO [primary] @@ -90,6 +92,8 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null ENUM_ENTRY name:ZERO + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Test1.ZERO' class: CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test1] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.ZERO CONSTRUCTOR visibility:private <> () returnType:.Test1.ZERO [primary] @@ -97,6 +101,8 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test1' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test1]' ENUM_ENTRY name:ONE + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Test1.ONE' class: CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[.Test1] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.ONE CONSTRUCTOR visibility:private <> () returnType:.Test1.ONE [primary] @@ -169,6 +175,8 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null ENUM_ENTRY name:ZERO + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Test2.ZERO' class: CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.ZERO CONSTRUCTOR visibility:private <> () returnType:.Test2.ZERO [primary] @@ -181,6 +189,8 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="ZERO" ENUM_ENTRY name:ONE + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Test2.ONE' class: CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[.Test2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.ONE CONSTRUCTOR visibility:private <> () returnType:.Test2.ONE [primary] diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt index e99fe82544e..a6967df03dd 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt @@ -35,6 +35,8 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt : .TestEnum INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.TestEnum>]' ENUM_ENTRY name:ENTRY1 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum.ENTRY1' class: CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:private superTypes:[.TestEnum] annotations: TestAnn(x = 'ENTRY1') @@ -44,6 +46,8 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:private superTypes:[.TestEnum]' ENUM_ENTRY name:ENTRY2 + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum.ENTRY2' class: CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[.TestEnum] annotations: TestAnn(x = 'ENTRY2') diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index b4878db22c4..26c81009444 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -7,6 +7,8 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt : .X INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum<.X>]' ENUM_ENTRY name:B + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .X.B' class: CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[.X] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X.B CONSTRUCTOR visibility:private <> () returnType:.X.B [primary] diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 2ae61d1bd32..0c73af2b664 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -7,6 +7,8 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt : .MyEnum INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyEnum>]' ENUM_ENTRY name:Z + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z' class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.MyEnum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z [primary] diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index f3f3a7145b5..9b6254ac366 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -28,6 +28,8 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final]' type=kotlin.String? origin=null receiver: GET_VAR ': .En declared in .En.' type=.En origin=null ENUM_ENTRY name:ENTRY + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .En.ENTRY' class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.En] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.ENTRY CONSTRUCTOR visibility:private <> () returnType:.En.ENTRY [primary] diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index 6e0cd205691..8157d1bb8ce 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -7,6 +7,8 @@ FILE fqName: fileName:/enumEntry.kt : .Z INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<.Z>]' ENUM_ENTRY name:ENTRY + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.ENTRY' class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.Z] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary]