From 1a861b2df9094e8a06f565563763280d839e368b Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Sun, 12 Jul 2020 10:30:48 +0300 Subject: [PATCH] FIR2IR: don't create synthetic class for enum entry w/o members --- .../fir/serialization/FirElementSerializer.kt | 2 +- .../fir/backend/Fir2IrClassifierStorage.kt | 13 +- .../kotlin/fir/backend/Fir2IrVisitor.kt | 50 ++- .../generators/ClassMemberGenerator.kt | 2 +- .../box/reflection/constructors/enumEntry.kt | 1 - .../testData/ir/irText/classes/enum.fir.txt | 364 +----------------- .../irText/classes/enumClassModality.fir.txt | 50 +-- .../classes/enumWithMultipleCtors.fir.txt | 144 +------ .../classes/enumWithSecondaryCtor.fir.txt | 146 +------ .../enumEntriesWithAnnotations.fir.txt | 44 +-- .../temporaryInEnumEntryInitializer.fir.txt | 74 +--- 11 files changed, 85 insertions(+), 805 deletions(-) diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt index 2f01e02d5bd..a289128ced5 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt @@ -135,7 +135,7 @@ class FirElementSerializer private constructor( ?: klass.declarations.filterIsInstance>() for (declaration in callableMembers) { - if (declaration.isStatic) continue // ??? Miss values() & valueOf() + if (declaration !is FirEnumEntry && declaration.isStatic) continue // ??? Miss values() & valueOf() when (declaration) { is FirProperty -> propertyProto(declaration)?.let { builder.addProperty(it) } is FirSimpleFunction -> functionProto(declaration)?.let { builder.addFunction(it) } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt index 37a0e26ede6..85ac7b7329f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt @@ -396,11 +396,14 @@ class Fir2IrClassifierStorage( this.parent = irParent } val initializer = enumEntry.initializer - if (initializer != null) { - initializer as FirAnonymousObject - val klass = getIrAnonymousObjectForEnumEntry(initializer, enumEntry.name, irParent) - - this.correspondingClass = klass + if (initializer is FirAnonymousObject) { + // An enum entry with its own members + if (initializer.declarations.any { it !is FirConstructor }) { + val klass = getIrAnonymousObjectForEnumEntry(initializer, enumEntry.name, irParent) + this.correspondingClass = klass + } + // Otherwise, this is a default-ish enum entry whose initializer would be a delegating constructor call, + // which will be translated via visitor later. } else if (irParent != null && origin == IrDeclarationOrigin.DEFINED) { val constructor = irParent.constructors.first() this.initializerExpression = IrExpressionBodyImpl( 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 df6b1861c3a..96e2d9c2165 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 @@ -106,26 +106,40 @@ class Fir2IrVisitor( override fun visitEnumEntry(enumEntry: FirEnumEntry, data: Any?): IrElement { val irEnumEntry = classifierStorage.getCachedIrEnumEntry(enumEntry)!! - val correspondingClass = irEnumEntry.correspondingClass ?: return irEnumEntry - declarationStorage.enterScope(irEnumEntry) - classifierStorage.putEnumEntryClassInScope(enumEntry, correspondingClass) - val anonymousObject = enumEntry.initializer as FirAnonymousObject - converter.processAnonymousObjectMembers(anonymousObject, correspondingClass) - conversionScope.withParent(correspondingClass) { - conversionScope.withContainingFirClass(anonymousObject) { - memberGenerator.convertClassContent(correspondingClass, anonymousObject) - } - val constructor = correspondingClass.constructors.first() - irEnumEntry.initializerExpression = IrExpressionBodyImpl( - IrEnumConstructorCallImpl( - startOffset, endOffset, enumEntry.returnTypeRef.toIrType(), - constructor.symbol, - typeArgumentsCount = constructor.typeParameters.size, - valueArgumentsCount = constructor.valueParameters.size + val correspondingClass = irEnumEntry.correspondingClass + val initializer = enumEntry.initializer + // If then enum entry has its own members, we need to introduce a synthetic class. + if (correspondingClass != null) { + declarationStorage.enterScope(irEnumEntry) + classifierStorage.putEnumEntryClassInScope(enumEntry, correspondingClass) + val anonymousObject = enumEntry.initializer as FirAnonymousObject + converter.processAnonymousObjectMembers(anonymousObject, correspondingClass) + conversionScope.withParent(correspondingClass) { + conversionScope.withContainingFirClass(anonymousObject) { + memberGenerator.convertClassContent(correspondingClass, anonymousObject) + } + val constructor = correspondingClass.constructors.first() + irEnumEntry.initializerExpression = IrExpressionBodyImpl( + IrEnumConstructorCallImpl( + startOffset, endOffset, enumEntry.returnTypeRef.toIrType(), + constructor.symbol, + typeArgumentsCount = constructor.typeParameters.size, + valueArgumentsCount = constructor.valueParameters.size + ) ) - ) + } + declarationStorage.leaveScope(irEnumEntry) + } else if (initializer is FirAnonymousObject) { + // Otherwise, this is a default-ish enum entry, which doesn't need its own synthetic class. + // During raw FIR building, we put the delegated constructor call inside an anonymous object. + val primaryConstructor = initializer.getPrimaryConstructorIfAny() + val delegatedConstructor = primaryConstructor?.delegatedConstructor + if (delegatedConstructor != null) { + with(memberGenerator) { + irEnumEntry.initializerExpression = IrExpressionBodyImpl(delegatedConstructor.toIrDelegatingConstructorCall()) + } + } } - declarationStorage.leaveScope(irEnumEntry) return irEnumEntry } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt index bc014c19dfb..58310aa7d2d 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt @@ -272,7 +272,7 @@ internal class ClassMemberGenerator( return this } - private fun FirDelegatedConstructorCall.toIrDelegatingConstructorCall(): IrExpression { + internal fun FirDelegatedConstructorCall.toIrDelegatingConstructorCall(): IrExpression { val constructedIrType = constructedTypeRef.toIrType() val referencedSymbol = (this.calleeReference as? FirResolvedNamedReference)?.resolvedSymbol as? FirConstructorSymbol ?: return convertWithOffsets { startOffset, endOffset -> diff --git a/compiler/testData/codegen/box/reflection/constructors/enumEntry.kt b/compiler/testData/codegen/box/reflection/constructors/enumEntry.kt index e2876644c54..35faa278811 100644 --- a/compiler/testData/codegen/box/reflection/constructors/enumEntry.kt +++ b/compiler/testData/codegen/box/reflection/constructors/enumEntry.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR, JS, NATIVE // IGNORE_BACKEND: JS_IR_ES6 // WITH_REFLECT diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt index bff1d9cc992..df35e714895 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -72,154 +72,16 @@ FILE fqName: fileName:/enum.kt 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' - x: CONST Int type=kotlin.Int value=1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[.TestEnum2]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum2 - $this: VALUE_PARAMETER name: type:.TestEnum2 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum2, other:.TestEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum2 - VALUE_PARAMETER name:other index:0 type:.TestEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=1 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' - x: CONST Int type=kotlin.Int value=2 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[.TestEnum2]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum2 - $this: VALUE_PARAMETER name: type:.TestEnum2 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum2, other:.TestEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum2 - VALUE_PARAMETER name:other index:0 type:.TestEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=2 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' - x: CONST Int type=kotlin.Int value=3 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[.TestEnum2]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum2 - $this: VALUE_PARAMETER name: type:.TestEnum2 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum2, other:.TestEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum2 - VALUE_PARAMETER name:other index:0 type:.TestEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=3 FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum2> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum2 @@ -569,152 +431,14 @@ FILE fqName: fileName:/enum.kt 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] - BLOCK_BODY - 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]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum5 - $this: VALUE_PARAMETER name: type:.TestEnum5 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum5, other:.TestEnum5) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum5 - VALUE_PARAMETER name:other index:0 type:.TestEnum5 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .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] - BLOCK_BODY - 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]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum5 - $this: VALUE_PARAMETER name: type:.TestEnum5 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum5, other:.TestEnum5) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum5 - VALUE_PARAMETER name:other index:0 type:.TestEnum5 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' - x: CONST Int type=kotlin.Int value=0 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[.TestEnum5]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum5 - $this: VALUE_PARAMETER name: type:.TestEnum5 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum5, other:.TestEnum5) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum5 - VALUE_PARAMETER name:other index:0 type:.TestEnum5 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' + x: CONST Int type=kotlin.Int value=0 FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum5> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum5 @@ -791,66 +515,14 @@ FILE fqName: fileName:/enum.kt 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] - BLOCK_BODY - BLOCK type=.TestEnum6 origin=ARGUMENTS_REORDERING_FOR_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - CALL 'public final fun f (): kotlin.Int declared in ' type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] - CALL 'public final fun f (): kotlin.Int declared in ' type=kotlin.Int origin=null - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .TestEnum6' - x: GET_VAR 'val tmp_1: kotlin.Int [val] declared in .TestEnum6.TEST.' type=kotlin.Int origin=null - y: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .TestEnum6.TEST.' type=kotlin.Int origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[.TestEnum6]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum6) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum6 - $this: VALUE_PARAMETER name: type:.TestEnum6 - PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum6) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestEnum6 - $this: VALUE_PARAMETER name: type:.TestEnum6 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum6, other:.TestEnum6) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum6 - VALUE_PARAMETER name:other index:0 type:.TestEnum6 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + BLOCK type=.TestEnum6 origin=ARGUMENTS_REORDERING_FOR_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] + CALL 'public final fun f (): kotlin.Int declared in ' type=kotlin.Int origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] + CALL 'public final fun f (): kotlin.Int declared in ' type=kotlin.Int origin=null + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .TestEnum6' + x: GET_VAR 'val tmp_1: kotlin.Int [val] declared in .TestEnum6' type=kotlin.Int origin=null + y: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .TestEnum6' type=kotlin.Int origin=null FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestEnum6> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestEnum6 diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt index 0937d29949e..954bc160f03 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt @@ -69,54 +69,8 @@ FILE fqName: fileName:/enumClassModality.kt 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestFinalEnum2' - x: CONST Int type=kotlin.Int value=1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[.TestFinalEnum2]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .TestFinalEnum2 - $this: VALUE_PARAMETER name: type:.TestFinalEnum2 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestFinalEnum2, other:.TestFinalEnum2) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestFinalEnum2 - VALUE_PARAMETER name:other index:0 type:.TestFinalEnum2 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestFinalEnum2' + x: CONST Int type=kotlin.Int value=1 FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.TestFinalEnum2> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.TestFinalEnum2 diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt index 5add618d859..d130ead8030 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt @@ -3,76 +3,8 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt $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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (arg: kotlin.String) declared in .A' - arg: CONST String type=kotlin.String value="asd" - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X modality:FINAL visibility:private superTypes:[.A]' - PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - PROPERTY FAKE_OVERRIDE name:prop2 visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop2 visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A, :kotlin.String) returnType:kotlin.Unit [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - overridden: - public final fun (: kotlin.String): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name: index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String [fake_override] - overridden: - public open fun f (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.A, other:.A) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:other index:0 type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (arg: kotlin.String) declared in .A' + arg: CONST String type=kotlin.String value="asd" ENUM_ENTRY name:Y init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .A.Y' @@ -152,76 +84,8 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt $this: VALUE_PARAMETER name: type:kotlin.Enum 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .A' - x: CONST Int type=kotlin.Int value=5 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[.A]' - PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop1 visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - PROPERTY FAKE_OVERRIDE name:prop2 visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop2 visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - overridden: - public final fun (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.A, :kotlin.String) returnType:kotlin.Unit [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop3 visibility:public modality:FINAL [fake_override,var] - overridden: - public final fun (: kotlin.String): kotlin.Unit declared in .A - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name: index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:f visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String [fake_override] - overridden: - public open fun f (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.A - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.A, other:.A) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:other index:0 type:.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) declared in .A' + x: CONST Int type=kotlin.Int value=5 PROPERTY name:prop1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final] FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt index c23160d00e7..5014ffbdad5 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt @@ -20,53 +20,7 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test0' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test0]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test0) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test0 - $this: VALUE_PARAMETER name: type:.Test0 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.Test0, other:.Test0) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.Test0 - VALUE_PARAMETER name:other index:0 type:.Test0 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test0' CONSTRUCTOR visibility:private <> () returnType:.Test0 BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test0' @@ -131,103 +85,11 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .Test1' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[.Test1]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test1 - $this: VALUE_PARAMETER name: type:.Test1 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.Test1, other:.Test1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.Test1 - VALUE_PARAMETER name:other index:0 type:.Test1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' - x: CONST Int type=kotlin.Int value=1 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[.Test1]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Test1 - $this: VALUE_PARAMETER name: type:.Test1 - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.Test1, other:.Test1) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.Test1 - VALUE_PARAMETER name:other index:0 type:.Test1 - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' + x: CONST Int type=kotlin.Int value=1 CONSTRUCTOR visibility:private <> () returnType:.Test1 BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt index 348697f6c92..864cd0a6bc3 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt @@ -36,49 +36,7 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt 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' - class: CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:private superTypes:[.TestEnum] - annotations: - TestAnn(x = 'ENTRY1') - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum.ENTRY1 - CONSTRUCTOR visibility:private <> () returnType:.TestEnum.ENTRY1 [primary] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:private superTypes:[.TestEnum]' - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.TestEnum, other:.TestEnum) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.TestEnum - VALUE_PARAMETER name:other index:0 type:.TestEnum - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum' ENUM_ENTRY name:ENTRY2 init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .TestEnum.ENTRY2' diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index ce846847ceb..033ae4b5121 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -29,66 +29,20 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt 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] - BLOCK_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.String?) [primary] declared in .En' - x: BLOCK type=kotlin.String? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] - CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=GET_PROPERTY - WHEN type=kotlin.String? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En.ENTRY.' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En.ENTRY.' type=kotlin.Any? origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[.En]' - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String? [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String? declared in .En - $this: VALUE_PARAMETER name: type:.En - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] - overridden: - protected final fun clone (): kotlin.Any declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:.En, other:.En) returnType:kotlin.Int [fake_override,operator] - overridden: - public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:.En - VALUE_PARAMETER name:other index:0 type:.En - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - overridden: - public final fun hashCode (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.String declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum - PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in kotlin.Enum - $this: VALUE_PARAMETER name: type:kotlin.Enum + ENUM_CONSTRUCTOR_CALL 'private constructor (x: kotlin.String?) [primary] declared in .En' + x: BLOCK type=kotlin.String? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] + CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=GET_PROPERTY + WHEN type=kotlin.String? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En