From 65a44e2e207a950ac766ef98d84c34f8cbe16670 Mon Sep 17 00:00:00 2001 From: "simon.ogorodnik" Date: Mon, 30 Dec 2019 13:49:31 +0300 Subject: [PATCH] Migrate to FirEnumEntry --- .../fir/java/enhancement/javaTypeUtils.kt | 4 +- .../converter/DeclarationsConverter.kt | 10 +- .../kotlin/fir/builder/RawFirBuilder.kt | 8 +- .../AbstractAnnotationDeserializer.kt | 4 +- .../deserialization/ClassDeserialization.kt | 22 +-- .../fir/resolve/impl/FirProviderImpl.kt | 4 + .../FirWhenExhaustivenessTransformer.kt | 11 +- .../fir/resolve/testData/builtIns/kotlin.txt | 18 +- .../AnnotationInAnnotationArguments.txt | 6 +- .../EnumArgumentWithCustomToString.txt | 6 +- .../annotations/classMembers/EnumEntry.txt | 24 +-- .../enum/EnumVisibility.txt | 18 +- .../enum/EnumWithConstuctor.txt | 18 +- .../enum/EnumWithInnerClasses.txt | 12 +- .../loadCompiledKotlin/enum/InnerEnum.txt | 6 +- .../enum/InnerEnumExistingClassObject.txt | 6 +- .../loadCompiledKotlin/enum/SimpleEnum.txt | 6 +- .../loadCompiledKotlin/fromLoadJava/Enum.txt | 12 +- .../memberOrder/EnumEntries.txt | 48 +---- .../fir/resolve/testData/resolve/enum.txt | 8 +- .../testData/resolve/enumWithCompanion.txt | 8 +- .../testData/resolve/exhaustiveness_enum.txt | 12 +- .../resolve/expresssions/enumValues.txt | 12 +- .../expresssions/qualifiedExpressions.txt | 4 +- .../testData/resolve/fromBuilder/enums.txt | 24 +-- .../fir/declarations/FirDeclarationUtil.kt | 11 +- .../ir/irText/singletons/enumEntry.fir.txt | 177 +++++++++++------- 27 files changed, 182 insertions(+), 317 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt index 8cc3ed2ccf8..7509b5afff3 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt @@ -365,11 +365,11 @@ internal fun ConeKotlinType.lexicalCastFrom(session: FirSession, value: String): val firElement = lookupTag.toSymbol(session)?.fir if (firElement is FirRegularClass && firElement.classKind == ClassKind.ENUM_CLASS) { val name = Name.identifier(value) - val firEnumEntry = firElement.collectEnumEntries().find { it.callableId.callableName == name } + val firEnumEntry = firElement.collectEnumEntries().find { it.name == name } return if (firEnumEntry != null) FirQualifiedAccessExpressionImpl(null).apply { calleeReference = FirResolvedNamedReferenceImpl( - null, name, firEnumEntry + null, name, firEnumEntry.symbol ) } else if (firElement is FirJavaClass) { val firStaticProperty = firElement.declarations.filterIsInstance().find { diff --git a/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt b/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt index e71f4a56ef8..5cb0b370037 100644 --- a/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt +++ b/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt @@ -515,7 +515,7 @@ class DeclarationsConverter( /** * @see org.jetbrains.kotlin.parsing.KotlinParsing.parseEnumEntry */ - private fun convertEnumEntry(enumEntry: LighterASTNode, classWrapper: ClassWrapper): FirProperty { + private fun convertEnumEntry(enumEntry: LighterASTNode, classWrapper: ClassWrapper): FirEnumEntry { var modifiers = Modifier() lateinit var identifier: String var hasInitializerList = false @@ -534,11 +534,10 @@ class DeclarationsConverter( } val enumEntryName = identifier.nameAsSafeName() - return FirPropertyImpl( + return FirEnumEntryImpl( null, session, classWrapper.delegatedSelfTypeRef, - receiverTypeRef = null, name = enumEntryName, initializer = FirAnonymousObjectImpl( null, @@ -566,10 +565,7 @@ class DeclarationsConverter( convertPrimaryConstructor(null, enumClassWrapper)?.let { declarations += it.firConstructor } classBodyNode?.also { declarations += convertClassBody(it, enumClassWrapper) } }, - delegate = null, - isVar = false, - symbol = FirPropertySymbol(CallableId(context.currentClassId, enumEntryName)), - isLocal = false, + symbol = FirVariableSymbol(CallableId(context.currentClassId, enumEntryName)), status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply { isStatic = true } diff --git a/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index f21a5f16fb7..1757318d920 100644 --- a/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -486,22 +486,18 @@ class RawFirBuilder(session: FirSession, val scopeProvider: FirScopeProvider, va ) } - return FirPropertyImpl( + return FirEnumEntryImpl( source = toFirSourceElement(), session, delegatedEnumSelfTypeRef, - receiverTypeRef = null, name = nameAsSafeName, initializer = obj, - delegate = null, - isVar = false, - isLocal = false, status = FirDeclarationStatusImpl( Visibilities.PUBLIC, Modality.FINAL ).apply { isStatic = true }, - symbol = FirPropertySymbol(callableIdForName(nameAsSafeName)) + symbol = FirVariableSymbol(callableIdForName(nameAsSafeName)) ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt index a68d6f3fa4c..fdb9a0f6d7c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/AbstractAnnotationDeserializer.kt @@ -140,9 +140,9 @@ abstract class AbstractAnnotationDeserializer( val enumSymbol = enumLookupTag.toSymbol(this@AbstractAnnotationDeserializer.session) val firClass = enumSymbol?.fir as? FirRegularClass val enumEntries = firClass?.collectEnumEntries() ?: emptyList() - val enumEntrySymbol = enumEntries.find { it.callableId.callableName == entryName } + val enumEntrySymbol = enumEntries.find { it.name == entryName } this.calleeReference = enumEntrySymbol?.let { - FirResolvedNamedReferenceImpl(null, entryName, it) + FirResolvedNamedReferenceImpl(null, entryName, it.symbol) } ?: FirErrorNamedReferenceImpl( null, FirSimpleDiagnostic("Strange deserialized enum value: $classId.$entryName", DiagnosticKind.DeserializationError) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt index e2bc4ad9dad..8e976644cfa 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt @@ -18,10 +18,7 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirSealedClassImpl import org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider import org.jetbrains.kotlin.fir.declarations.impl.* import org.jetbrains.kotlin.fir.symbols.CallableId -import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl -import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousObjectSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol +import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl import org.jetbrains.kotlin.metadata.ProtoBuf @@ -129,24 +126,13 @@ fun deserializeClassToSymbol( val enumEntryName = nameResolver.getName(enumEntryProto.name) val enumType = ConeClassLikeTypeImpl(symbol.toLookupTag(), emptyArray(), false) - val property = FirPropertyImpl( + val property = FirEnumEntryImpl( null, session, FirResolvedTypeRefImpl(null, enumType), - null, enumEntryName, - initializer = FirAnonymousObjectImpl( - null, - session, - classKind = ClassKind.ENUM_ENTRY, - symbol = FirAnonymousObjectSymbol() - ).apply { - superTypeRefs += FirResolvedTypeRefImpl(source = null, type = enumType) - }, - delegate = null, - isVar = false, - symbol = FirPropertySymbol(CallableId(classId, enumEntryName)), - isLocal = false, + initializer = null, + symbol = FirVariableSymbol(CallableId(classId, enumEntryName)), status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply { isStatic = true } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirProviderImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirProviderImpl.kt index 7fdae58c26e..f1a035746dc 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirProviderImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirProviderImpl.kt @@ -107,6 +107,10 @@ class FirProviderImpl(val session: FirSession, val kotlinScopeProvider: KotlinSc override fun visitProperty(property: FirProperty) { visitCallableDeclaration(property) } + + override fun visitEnumEntry(enumEntry: FirEnumEntry) { + visitCallableDeclaration(enumEntry) + } }) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirWhenExhaustivenessTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirWhenExhaustivenessTransformer.kt index 88131348da9..efdadf6f96a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirWhenExhaustivenessTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirWhenExhaustivenessTransformer.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol import org.jetbrains.kotlin.fir.types.ConeLookupTagBasedType import org.jetbrains.kotlin.fir.types.ConeNullability import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef @@ -74,7 +75,7 @@ class FirWhenExhaustivenessTransformer(private val bodyResolveComponents: BodyRe private fun checkEnumExhaustiveness(whenExpression: FirWhenExpression, enum: FirRegularClass, nullable: Boolean): Boolean { val data = EnumExhaustivenessData( - enum.collectEnumEntries().toMutableSet(), + enum.collectEnumEntries().map { it.symbol }.toMutableSet(), !nullable ) for (branch in whenExpression.branches) { @@ -83,7 +84,7 @@ class FirWhenExhaustivenessTransformer(private val bodyResolveComponents: BodyRe return data.containsNull && data.remainingEntries.isEmpty() } - private class EnumExhaustivenessData(val remainingEntries: MutableSet, var containsNull: Boolean) + private class EnumExhaustivenessData(val remainingEntries: MutableSet>, var containsNull: Boolean) private object EnumExhaustivenessVisitor : FirVisitor() { override fun visitElement(element: FirElement, data: EnumExhaustivenessData) {} @@ -98,9 +99,9 @@ class FirWhenExhaustivenessTransformer(private val bodyResolveComponents: BodyRe } is FirQualifiedAccessExpression -> { val reference = argument.calleeReference as? FirResolvedNamedReference ?: return - val symbol = reference.resolvedSymbol - if (symbol is FirPropertySymbol) - data.remainingEntries.remove(symbol) + val symbol = (reference.resolvedSymbol.fir as? FirEnumEntry)?.symbol ?: return + + data.remainingEntries.remove(symbol) } } } diff --git a/compiler/fir/resolve/testData/builtIns/kotlin.txt b/compiler/fir/resolve/testData/builtIns/kotlin.txt index abc9a3b0d0c..98b4b459925 100644 --- a/compiler/fir/resolve/testData/builtIns/kotlin.txt +++ b/compiler/fir/resolve/testData/builtIns/kotlin.txt @@ -365,21 +365,9 @@ public abstract interface Comparable : R|kotlin/Any| { public final enum class DeprecationLevel : R|kotlin/Enum| { private constructor(): R|kotlin/DeprecationLevel| - public final static val WARNING: R|kotlin/DeprecationLevel| = object : R|kotlin/DeprecationLevel| { - } - - - - public final static val ERROR: R|kotlin/DeprecationLevel| = object : R|kotlin/DeprecationLevel| { - } - - - - public final static val HIDDEN: R|kotlin/DeprecationLevel| = object : R|kotlin/DeprecationLevel| { - } - - - + public final static enum entry WARNING: R|kotlin/DeprecationLevel| + public final static enum entry ERROR: R|kotlin/DeprecationLevel| + public final static enum entry HIDDEN: R|kotlin/DeprecationLevel| } public final class Double : R|kotlin/Number|, R|kotlin/Comparable| { diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt index 05e3b95d06a..a19602ba3d9 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt @@ -6,11 +6,7 @@ public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| - public final static val ENTRY: R|test/E| = object : R|test/E| { - } - - - + public final static enum entry ENTRY: R|test/E| } public final annotation class EnumOption : R|kotlin/Annotation| { diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt index 6a6166e6cd6..b6ab536585c 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt @@ -1,11 +1,7 @@ public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| - public final static val CAKE: R|test/E| = object : R|test/E| { - } - - - + public final static enum entry CAKE: R|test/E| } public final annotation class EnumAnno : R|kotlin/Annotation| { diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt index 02acb2f9b3f..bf081b096de 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt @@ -17,25 +17,9 @@ public final annotation class Bnno : R|kotlin/Annotation| { public final enum class Eee : R|kotlin/Enum| { private constructor(): R|test/Eee| - public final static val Entry1: R|test/Eee| = object : R|test/Eee| { - } - - - - public final static val Entry2: R|test/Eee| = object : R|test/Eee| { - } - - - - public final static val Entry3: R|test/Eee| = object : R|test/Eee| { - } - - - - public final static val Entry4: R|test/Eee| = object : R|test/Eee| { - } - - - + public final static enum entry Entry1: R|test/Eee| + public final static enum entry Entry2: R|test/Eee| + public final static enum entry Entry3: R|test/Eee| + public final static enum entry Entry4: R|test/Eee| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt index d5a2f7a1611..5ca4878af1b 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt @@ -1,30 +1,18 @@ internal final enum class In : R|kotlin/Enum| { private constructor(): R|test/In| - public final static val A: R|test/In| = object : R|test/In| { - } - - - + public final static enum entry A: R|test/In| } private final enum class Pr : R|kotlin/Enum| { private constructor(): R|test/Pr| - public final static val A: R|test/Pr| = object : R|test/Pr| { - } - - - + public final static enum entry A: R|test/Pr| } public final enum class Pu : R|kotlin/Enum| { private constructor(): R|test/Pu| - public final static val A: R|test/Pu| = object : R|test/Pu| { - } - - - + public final static enum entry A: R|test/Pu| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt index eb33e62efc9..cded75f09af 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt @@ -7,20 +7,8 @@ public final enum class En : R|kotlin/Enum| { private constructor(b: R|kotlin/Boolean| = STUB, i: R|kotlin/Int| = STUB): R|test/En| - public final static val E1: R|test/En| = object : R|test/En| { - } - - - - public final static val E2: R|test/En| = object : R|test/En| { - } - - - - public final static val E3: R|test/En| = object : R|test/En| { - } - - - + public final static enum entry E1: R|test/En| + public final static enum entry E2: R|test/En| + public final static enum entry E3: R|test/En| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt index 5ddb2d18ffb..ad208dec6c2 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt @@ -19,15 +19,7 @@ public final enum class Enum : R|kotlin/Enum| { public abstract interface Trait : R|kotlin/Any| { } - public final static val ENTRY1: R|test/Enum| = object : R|test/Enum| { - } - - - - public final static val ENTRY2: R|test/Enum| = object : R|test/Enum| { - } - - - + public final static enum entry ENTRY1: R|test/Enum| + public final static enum entry ENTRY2: R|test/Enum| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt index 6dd1c2dcee2..1fe0a5aa70e 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt @@ -4,11 +4,7 @@ public final class A : R|kotlin/Any| { public final enum class E : R|kotlin/Enum| { private constructor(): R|test/A.E| - public final static val ENTRY: R|test/A.E| = object : R|test/A.E| { - } - - - + public final static enum entry ENTRY: R|test/A.E| } } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt index e9c23c1a12b..abe18dcabd8 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt @@ -9,11 +9,7 @@ public final class A : R|kotlin/Any| { public final enum class E : R|kotlin/Enum| { private constructor(): R|test/A.E| - public final static val ENTRY: R|test/A.E| = object : R|test/A.E| { - } - - - + public final static enum entry ENTRY: R|test/A.E| } } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt index 1dd253b5e3a..1b721953a87 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt @@ -1,10 +1,6 @@ public final enum class MyEnum : R|kotlin/Enum| { private constructor(): R|test/MyEnum| - public final static val ENTRY: R|test/MyEnum| = object : R|test/MyEnum| { - } - - - + public final static enum entry ENTRY: R|test/MyEnum| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt index 3349d028408..fd1e1ab3c29 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt @@ -1,15 +1,7 @@ public final enum class Test : R|kotlin/Enum| { private constructor(a: R|kotlin/Int|): R|test/Test| - public final static val A: R|test/Test| = object : R|test/Test| { - } - - - - public final static val B: R|test/Test| = object : R|test/Test| { - } - - - + public final static enum entry A: R|test/Test| + public final static enum entry B: R|test/Test| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt index 3fc79999b53..418af378d26 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt @@ -1,45 +1,13 @@ public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| - public final static val ONE: R|test/E| = object : R|test/E| { - } - - - - public final static val TWO: R|test/E| = object : R|test/E| { - } - - - - public final static val THREE: R|test/E| = object : R|test/E| { - } - - - - public final static val FOUR: R|test/E| = object : R|test/E| { - } - - - - public final static val FIVE: R|test/E| = object : R|test/E| { - } - - - - public final static val SIX: R|test/E| = object : R|test/E| { - } - - - - public final static val SEVEN: R|test/E| = object : R|test/E| { - } - - - - public final static val EIGHT: R|test/E| = object : R|test/E| { - } - - - + public final static enum entry ONE: R|test/E| + public final static enum entry TWO: R|test/E| + public final static enum entry THREE: R|test/E| + public final static enum entry FOUR: R|test/E| + public final static enum entry FIVE: R|test/E| + public final static enum entry SIX: R|test/E| + public final static enum entry SEVEN: R|test/E| + public final static enum entry EIGHT: R|test/E| } diff --git a/compiler/fir/resolve/testData/resolve/enum.txt b/compiler/fir/resolve/testData/resolve/enum.txt index 4f1c6bb8d40..a692ab9d30c 100644 --- a/compiler/fir/resolve/testData/resolve/enum.txt +++ b/compiler/fir/resolve/testData/resolve/enum.txt @@ -21,7 +21,7 @@ FILE: enum.kt public final val x: R|Some| = R|/x| public get(): R|Some| - public final static val FIRST: R|SomeEnum| = object : R|SomeEnum| { + public final static enum entry FIRST: R|SomeEnum| = object : R|SomeEnum| { private constructor(): R|anonymous| { super(Q|O1|) } @@ -32,9 +32,7 @@ FILE: enum.kt } - - - public final static val SECOND: R|SomeEnum| = object : R|SomeEnum| { + public final static enum entry SECOND: R|SomeEnum| = object : R|SomeEnum| { private constructor(): R|anonymous| { super(Q|O2|) } @@ -45,8 +43,6 @@ FILE: enum.kt } - - public abstract fun check(y: R|Some|): R|kotlin/Boolean| public final static fun values(): R|kotlin/Array| { diff --git a/compiler/fir/resolve/testData/resolve/enumWithCompanion.txt b/compiler/fir/resolve/testData/resolve/enumWithCompanion.txt index d7ee5170e39..894b2551c7d 100644 --- a/compiler/fir/resolve/testData/resolve/enumWithCompanion.txt +++ b/compiler/fir/resolve/testData/resolve/enumWithCompanion.txt @@ -4,24 +4,20 @@ FILE: enumWithCompanion.kt super() } - public final static val A: R|EC| = object : R|EC| { + public final static enum entry A: R|EC| = object : R|EC| { private constructor(): R|anonymous| { super() } } - - - public final static val B: R|EC| = object : R|EC| { + public final static enum entry B: R|EC| = object : R|EC| { private constructor(): R|anonymous| { super() } } - - public final companion object Companion : R|kotlin/Any| { private constructor(): R|EC.Companion| { super() diff --git a/compiler/fir/resolve/testData/resolve/exhaustiveness_enum.txt b/compiler/fir/resolve/testData/resolve/exhaustiveness_enum.txt index c91623738d7..96e665da8e0 100644 --- a/compiler/fir/resolve/testData/resolve/exhaustiveness_enum.txt +++ b/compiler/fir/resolve/testData/resolve/exhaustiveness_enum.txt @@ -4,33 +4,27 @@ FILE: exhaustiveness_enum.kt super() } - public final static val A: R|Enum| = object : R|Enum| { + public final static enum entry A: R|Enum| = object : R|Enum| { private constructor(): R|anonymous| { super() } } - - - public final static val B: R|Enum| = object : R|Enum| { + public final static enum entry B: R|Enum| = object : R|Enum| { private constructor(): R|anonymous| { super() } } - - - public final static val C: R|Enum| = object : R|Enum| { + public final static enum entry C: R|Enum| = object : R|Enum| { private constructor(): R|anonymous| { super() } } - - public final static fun values(): R|kotlin/Array| { } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt b/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt index 2e4547f5a34..d660e6f72bb 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt @@ -4,33 +4,27 @@ FILE: enumValues.kt super() } - public final static val FIRST: R|MyEnum| = object : R|MyEnum| { + public final static enum entry FIRST: R|MyEnum| = object : R|MyEnum| { private constructor(): R|anonymous| { super() } } - - - public final static val SECOND: R|MyEnum| = object : R|MyEnum| { + public final static enum entry SECOND: R|MyEnum| = object : R|MyEnum| { private constructor(): R|anonymous| { super() } } - - - public final static val LAST: R|MyEnum| = object : R|MyEnum| { + public final static enum entry LAST: R|MyEnum| = object : R|MyEnum| { private constructor(): R|anonymous| { super() } } - - public final fun bar(): R|kotlin/Int| { ^bar Int(42) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.txt b/compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.txt index efc6a8e5d3a..56ad1dcccd0 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/qualifiedExpressions.txt @@ -33,15 +33,13 @@ FILE: qualifiedExpressions.kt super() } - public final static val entry: R|a/b/E| = object : R|a/b/E| { + public final static enum entry entry: R|a/b/E| = object : R|a/b/E| { private constructor(): R|anonymous| { super() } } - - public final static fun values(): R|kotlin/Array| { } diff --git a/compiler/fir/resolve/testData/resolve/fromBuilder/enums.txt b/compiler/fir/resolve/testData/resolve/fromBuilder/enums.txt index 1c990484ca6..a8c370fc194 100644 --- a/compiler/fir/resolve/testData/resolve/fromBuilder/enums.txt +++ b/compiler/fir/resolve/testData/resolve/fromBuilder/enums.txt @@ -4,33 +4,27 @@ FILE: enums.kt super() } - public final static val FIRST: R|Order| = object : R|Order| { + public final static enum entry FIRST: R|Order| = object : R|Order| { private constructor(): R|anonymous| { super() } } - - - public final static val SECOND: R|Order| = object : R|Order| { + public final static enum entry SECOND: R|Order| = object : R|Order| { private constructor(): R|anonymous| { super() } } - - - public final static val THIRD: R|Order| = object : R|Order| { + public final static enum entry THIRD: R|Order| = object : R|Order| { private constructor(): R|anonymous| { super() } } - - public final static fun values(): R|kotlin/Array| { } @@ -49,7 +43,7 @@ FILE: enums.kt internal final val r: R|kotlin/Double| = R|/r| internal get(): R|kotlin/Double| - public final static val MERCURY: R|Planet| = object : R|Planet| { + public final static enum entry MERCURY: R|Planet| = object : R|Planet| { private constructor(): R|anonymous| { super(Double(1.0), Double(2.0)) } @@ -60,9 +54,7 @@ FILE: enums.kt } - - - public final static val VENERA: R|Planet| = object : R|Planet| { + public final static enum entry VENERA: R|Planet| = object : R|Planet| { private constructor(): R|anonymous| { super(Double(3.0), Double(4.0)) } @@ -73,9 +65,7 @@ FILE: enums.kt } - - - public final static val EARTH: R|Planet| = object : R|Planet| { + public final static enum entry EARTH: R|Planet| = object : R|Planet| { private constructor(): R|anonymous| { super(Double(5.0), Double(6.0)) } @@ -86,8 +76,6 @@ FILE: enums.kt } - - public final val g: R|kotlin/Double| = R|/Planet.Companion.G|.R|kotlin/Double.times|(R|/m|).R|kotlin/Double.div|(R|/r|.R|kotlin/Double.times|(R|/r|)) public get(): R|kotlin/Double| diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt index 8036b0132ef..85f60909c13 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationUtil.kt @@ -68,14 +68,7 @@ val FirClassSymbol<*>.superConeTypes val FirClass<*>.superConeTypes get() = superTypeRefs.mapNotNull { it.coneTypeSafe() } -fun FirRegularClass.collectEnumEntries(): Collection { +fun FirRegularClass.collectEnumEntries(): Collection { assert(classKind == ClassKind.ENUM_CLASS) - return declarations - .mapNotNull { - if (it !is FirProperty) return@mapNotNull null - val initializer = it.initializer - if (initializer == null || initializer !is FirAnonymousObject || initializer.classKind != ClassKind.ENUM_ENTRY) - return@mapNotNull null - return@mapNotNull it.symbol - } + return declarations.filterIsInstance() } \ No newline at end of file diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index 6b739a659d0..29bb0d86f72 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -1,94 +1,137 @@ FILE fqName: fileName:/enumEntry.kt - CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<.Z>] + CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z - CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + CONSTRUCTOR visibility:private <> () returnType:.Z [primary]h BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<.Z>]' - CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY - CONSTRUCTOR visibility:public <> () returnType:.Z.ENTRY [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY - BLOCK_BODY - CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A - CONSTRUCTOR visibility:public <> () returnType:.Z.ENTRY.A [primary] + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + : .Z + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:OPEN visibility:public superTypes:[kotlin.Enum<.Z>]' + ENUM_ENTRY name:ENTRY + init: ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.ENTRY' + class: CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[.Z] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY + CONSTRUCTOR visibility:private <> () returnType:.Z.ENTRY [primary] BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z.ENTRY.A + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + ENUM_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[.Z]' + FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY BLOCK_BODY - CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null - $this: GET_VAR ': .Z.ENTRY declared in .Z.ENTRY' type=.Z.ENTRY origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A + CONSTRUCTOR visibility:public <> ($this:.Z.ENTRY) returnType:.Z.ENTRY.A [primary] + $outer: VALUE_PARAMETER name: type:.Z.ENTRY + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null + $this: GET_ENUM 'ENUM_ENTRY name:ENTRY' type=.Z.ENTRY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Any [fake_override] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + protected final fun clone (): kotlin.Any [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ final fun finalize (): kotlin.Unit [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:java.lang.Class<.Z?>? [fake_override] + overridden: + public final fun getDeclaringClass (): java.lang.Class<.Z?>? [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: .Z): kotlin.Int [fake_override,operator] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + VALUE_PARAMETER name:other index:0 type:.Z + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + public final fun hashCode (): kotlin.Int [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:values visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Array<.Z> - $this: VALUE_PARAMETER name: type:.Z - BLOCK_BODY - FUN name:valueOf visibility:public modality:FINAL <> ($this:.Z, value:kotlin.String) returnType:.Z - $this: VALUE_PARAMETER name: type:.Z - VALUE_PARAMETER name:value index:0 type:kotlin.String - BLOCK_BODY - FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] + public open fun toString (): kotlin.String [fake_override] declared in .Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<.Z>) 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:kotlin.Enum, other:.Z) returnType:kotlin.Int [fake_override,operator] + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) returnType:java.lang.Class<.Z?>? [fake_override] + overridden: + public final fun getDeclaringClass (): java.lang.Class? declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, other:.Z) 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:kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> VALUE_PARAMETER name:other index:0 type:.Z - FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>, 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 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> 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] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) 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 + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) 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:.Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Z>) 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:.Z + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Z>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.Z> + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Z> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Z + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + + +