K1: add support for Enum.entries synthetic property (see KT-48872)

#KT-53270 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-07-25 11:40:32 +02:00
committed by Space
parent c0f81cbc45
commit 12e8b1d844
13 changed files with 247 additions and 62 deletions
@@ -36,5 +36,8 @@ interface DeserializationConfiguration {
val preserveDeclarationsOrdering: Boolean
get() = false
val supportEnumEntries: Boolean
get() = false
object Default : DeserializationConfiguration
}
@@ -52,7 +52,12 @@ class DeserializedClassDescriptor(
VersionRequirementTable.create(classProto.versionRequirementTable), metadataVersion
)
private val staticScope = if (kind == ClassKind.ENUM_CLASS) StaticScopeForKotlinEnum(c.storageManager, this) else MemberScope.Empty
private val staticScope =
if (kind == ClassKind.ENUM_CLASS)
StaticScopeForKotlinEnum(c.storageManager, this, c.components.configuration.supportEnumEntries)
else
MemberScope.Empty
private val typeConstructor = DeserializedClassTypeConstructor()
private val memberScopeHolder =