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
@@ -25,4 +25,6 @@ class CompilerDeserializationConfiguration(languageVersionSettings: LanguageVers
override val isJvmPackageNameSupported = languageVersionSettings.supportsFeature(LanguageFeature.JvmPackageName)
override val readDeserializedContracts: Boolean = languageVersionSettings.supportsFeature(LanguageFeature.ReadDeserializedContracts)
override val supportEnumEntries: Boolean = languageVersionSettings.supportsFeature(LanguageFeature.EnumEntries)
}
@@ -132,7 +132,10 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
this.scopesHolderForClass = createScopesHolderForClass(c, this.declarationProvider);
this.kind = classLikeInfo.getClassKind();
this.staticScope = kind == ClassKind.ENUM_CLASS ? new StaticScopeForKotlinEnum(storageManager, this) : MemberScope.Empty.INSTANCE;
this.staticScope = kind == ClassKind.ENUM_CLASS ?
new StaticScopeForKotlinEnum(
storageManager, this, c.getLanguageVersionSettings().supportsFeature(LanguageFeature.EnumEntries)
) : MemberScope.Empty.INSTANCE;
this.typeConstructor = new LazyClassTypeConstructor();