[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),
|
||||
backingFieldAnnotations = source.backingField?.annotations?.map(CirAnnotationFactory::create),
|
||||
delegateFieldAnnotations = source.delegateField?.annotations?.map(CirAnnotationFactory::create),
|
||||
compileTimeInitializer = source.compileTimeInitializer,
|
||||
isLiftedUp = false
|
||||
compileTimeInitializer = source.compileTimeInitializer
|
||||
)
|
||||
}
|
||||
|
||||
@@ -76,8 +75,7 @@ object CirPropertyFactory {
|
||||
setter: CirPropertySetter?,
|
||||
backingFieldAnnotations: List<CirAnnotation>?,
|
||||
delegateFieldAnnotations: List<CirAnnotation>?,
|
||||
compileTimeInitializer: ConstantValue<*>?,
|
||||
isLiftedUp: Boolean
|
||||
compileTimeInitializer: ConstantValue<*>?
|
||||
): CirProperty {
|
||||
return CirPropertyImpl(
|
||||
annotations = annotations,
|
||||
@@ -98,8 +96,7 @@ object CirPropertyFactory {
|
||||
setter = setter,
|
||||
backingFieldAnnotations = backingFieldAnnotations,
|
||||
delegateFieldAnnotations = delegateFieldAnnotations,
|
||||
compileTimeInitializer = compileTimeInitializer,
|
||||
isLiftedUp = isLiftedUp
|
||||
compileTimeInitializer = compileTimeInitializer
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -31,6 +31,8 @@ data class CirPropertyImpl(
|
||||
override val setter: CirPropertySetter?,
|
||||
override val backingFieldAnnotations: List<CirAnnotation>?,
|
||||
override val delegateFieldAnnotations: List<CirAnnotation>?,
|
||||
override val compileTimeInitializer: ConstantValue<*>?,
|
||||
override val isLiftedUp: Boolean
|
||||
) : CirProperty
|
||||
override val compileTimeInitializer: ConstantValue<*>?
|
||||
) : 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,
|
||||
backingFieldAnnotations = null,
|
||||
delegateFieldAnnotations = null,
|
||||
compileTimeInitializer = constCompileTimeInitializer,
|
||||
isLiftedUp = constCompileTimeInitializer != null
|
||||
compileTimeInitializer = constCompileTimeInitializer
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user