FIR: serialize HAS_CONSTANT at least for const properties

Non-const properties may need them too with if the 1.4 feature
NoConstantValueAttributeForNonConstVals is disabled.
This commit is contained in:
pyos
2020-11-27 11:38:21 +01:00
committed by Mikhail Glukhikh
parent 04d9afe83e
commit 1cccf2645f
8 changed files with 11 additions and 20 deletions
@@ -205,9 +205,6 @@ class FirElementSerializer private constructor(
var hasGetter = false
var hasSetter = false
//val compileTimeConstant = property.compileTimeInitializer
val hasConstant = false // TODO: compileTimeConstant != null && compileTimeConstant !is NullValue
val hasAnnotations = property.nonSourceAnnotations(session).isNotEmpty()
// TODO: hasAnnotations(descriptor) || hasAnnotations(descriptor.backingField) || hasAnnotations(descriptor.delegateField)
@@ -247,6 +244,7 @@ class FirElementSerializer private constructor(
}
}
val hasConstant = property.isConst // TODO: this is only correct with LanguageFeature.NoConstantValueAttributeForNonConstVals
val flags = Flags.getPropertyFlags(
hasAnnotations,
ProtoEnumFlags.visibility(normalizeVisibility(property)),