[Commonizer] Make CirProperty.[backing|delegate]FieldAnnotations non-nullable

There is effectively no difference between missing field and a field with no annotations.
This commit is contained in:
Dmitriy Dolovov
2021-02-19 23:31:40 +03:00
parent 215dd8515b
commit b3e68d3704
4 changed files with 10 additions and 10 deletions
@@ -13,7 +13,7 @@ interface CirProperty : CirFunctionOrProperty, CirLiftedUpDeclaration {
val isDelegate: Boolean
val getter: CirPropertyGetter?
val setter: CirPropertySetter?
val backingFieldAnnotations: List<CirAnnotation>? // null assumes no backing field
val delegateFieldAnnotations: List<CirAnnotation>? // null assumes no backing field
val backingFieldAnnotations: List<CirAnnotation>
val delegateFieldAnnotations: List<CirAnnotation>
val compileTimeInitializer: CirConstantValue<*>?
}
@@ -39,8 +39,8 @@ object CirPropertyFactory {
isDelegate = source.isDelegated,
getter = source.getter?.let(CirPropertyGetterFactory::create),
setter = source.setter?.let(CirPropertySetterFactory::create),
backingFieldAnnotations = source.backingField?.annotations?.compactMap(CirAnnotationFactory::create),
delegateFieldAnnotations = source.delegateField?.annotations?.compactMap(CirAnnotationFactory::create),
backingFieldAnnotations = source.backingField?.annotations?.compactMap(CirAnnotationFactory::create).orEmpty(),
delegateFieldAnnotations = source.delegateField?.annotations?.compactMap(CirAnnotationFactory::create).orEmpty(),
compileTimeInitializer = compileTimeInitializer
)
}
@@ -63,8 +63,8 @@ object CirPropertyFactory {
isDelegate: Boolean,
getter: CirPropertyGetter?,
setter: CirPropertySetter?,
backingFieldAnnotations: List<CirAnnotation>?,
delegateFieldAnnotations: List<CirAnnotation>?,
backingFieldAnnotations: List<CirAnnotation>,
delegateFieldAnnotations: List<CirAnnotation>,
compileTimeInitializer: CirConstantValue<*>?
): CirProperty {
return CirPropertyImpl(
@@ -27,8 +27,8 @@ data class CirPropertyImpl(
override val isDelegate: Boolean,
override val getter: CirPropertyGetter?,
override val setter: CirPropertySetter?,
override val backingFieldAnnotations: List<CirAnnotation>?,
override val delegateFieldAnnotations: List<CirAnnotation>?,
override val backingFieldAnnotations: List<CirAnnotation>,
override val delegateFieldAnnotations: List<CirAnnotation>,
override val compileTimeInitializer: CirConstantValue<*>?
) : CirProperty {
// const property in "common" fragment is already lifted up
@@ -45,8 +45,8 @@ class PropertyCommonizer(classifiers: CirKnownClassifiers) : AbstractFunctionOrP
isDelegate = false,
getter = CirPropertyGetterFactory.DEFAULT_NO_ANNOTATIONS,
setter = setter,
backingFieldAnnotations = null,
delegateFieldAnnotations = null,
backingFieldAnnotations = emptyList(),
delegateFieldAnnotations = emptyList(),
compileTimeInitializer = constCompileTimeInitializer
)
}