[Commonizer] Simplify detection if property is lifted up
This commit is contained in:
+3
-6
@@ -51,8 +51,7 @@ object CirPropertyFactory {
|
|||||||
setter = source.setter?.let(CirPropertySetterFactory::create),
|
setter = source.setter?.let(CirPropertySetterFactory::create),
|
||||||
backingFieldAnnotations = source.backingField?.annotations?.map(CirAnnotationFactory::create),
|
backingFieldAnnotations = source.backingField?.annotations?.map(CirAnnotationFactory::create),
|
||||||
delegateFieldAnnotations = source.delegateField?.annotations?.map(CirAnnotationFactory::create),
|
delegateFieldAnnotations = source.delegateField?.annotations?.map(CirAnnotationFactory::create),
|
||||||
compileTimeInitializer = source.compileTimeInitializer,
|
compileTimeInitializer = source.compileTimeInitializer
|
||||||
isLiftedUp = false
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,8 +75,7 @@ object CirPropertyFactory {
|
|||||||
setter: CirPropertySetter?,
|
setter: CirPropertySetter?,
|
||||||
backingFieldAnnotations: List<CirAnnotation>?,
|
backingFieldAnnotations: List<CirAnnotation>?,
|
||||||
delegateFieldAnnotations: List<CirAnnotation>?,
|
delegateFieldAnnotations: List<CirAnnotation>?,
|
||||||
compileTimeInitializer: ConstantValue<*>?,
|
compileTimeInitializer: ConstantValue<*>?
|
||||||
isLiftedUp: Boolean
|
|
||||||
): CirProperty {
|
): CirProperty {
|
||||||
return CirPropertyImpl(
|
return CirPropertyImpl(
|
||||||
annotations = annotations,
|
annotations = annotations,
|
||||||
@@ -98,8 +96,7 @@ object CirPropertyFactory {
|
|||||||
setter = setter,
|
setter = setter,
|
||||||
backingFieldAnnotations = backingFieldAnnotations,
|
backingFieldAnnotations = backingFieldAnnotations,
|
||||||
delegateFieldAnnotations = delegateFieldAnnotations,
|
delegateFieldAnnotations = delegateFieldAnnotations,
|
||||||
compileTimeInitializer = compileTimeInitializer,
|
compileTimeInitializer = compileTimeInitializer
|
||||||
isLiftedUp = isLiftedUp
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -31,6 +31,8 @@ data class CirPropertyImpl(
|
|||||||
override val setter: CirPropertySetter?,
|
override val setter: CirPropertySetter?,
|
||||||
override val backingFieldAnnotations: List<CirAnnotation>?,
|
override val backingFieldAnnotations: List<CirAnnotation>?,
|
||||||
override val delegateFieldAnnotations: List<CirAnnotation>?,
|
override val delegateFieldAnnotations: List<CirAnnotation>?,
|
||||||
override val compileTimeInitializer: ConstantValue<*>?,
|
override val compileTimeInitializer: ConstantValue<*>?
|
||||||
override val isLiftedUp: Boolean
|
) : CirProperty {
|
||||||
) : CirProperty
|
// const property in "common" fragment is already lifted up
|
||||||
|
override val isLiftedUp get() = isConst
|
||||||
|
}
|
||||||
|
|||||||
+1
-2
@@ -39,8 +39,7 @@ class PropertyCommonizer(cache: CirClassifiersCache) : AbstractFunctionOrPropert
|
|||||||
setter = setter,
|
setter = setter,
|
||||||
backingFieldAnnotations = null,
|
backingFieldAnnotations = null,
|
||||||
delegateFieldAnnotations = null,
|
delegateFieldAnnotations = null,
|
||||||
compileTimeInitializer = constCompileTimeInitializer,
|
compileTimeInitializer = constCompileTimeInitializer
|
||||||
isLiftedUp = constCompileTimeInitializer != null
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user