Analysis API FIR: fix exception in LC support for Enum.entries property

This commit is contained in:
Mikhail Glukhikh
2022-08-04 14:43:01 +02:00
committed by Space
parent d7c0b1b620
commit 41b73abc49
@@ -276,6 +276,7 @@ internal fun SymbolLightClassBase.createPropertyAccessors(
suppressStatic: Boolean = false,
) {
if (declaration is KtKotlinPropertySymbol && declaration.isConst) return
if (declaration.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED) return
if (declaration.visibility.isPrivateOrPrivateToThis() &&
declaration.getter?.hasBody == false &&
@@ -358,6 +359,7 @@ internal fun SymbolLightClassBase.createField(
fun hasBackingField(property: KtPropertySymbol): Boolean = when (property) {
is KtSyntheticJavaPropertySymbol -> true
is KtKotlinPropertySymbol -> when {
property.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED -> false
property.modality == Modality.ABSTRACT -> false
property.isHiddenOrSynthetic() -> false
property.isLateInit -> true