[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:
+2
-2
@@ -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<*>?
|
||||
}
|
||||
|
||||
+4
-4
@@ -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(
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user