[IR generator] Deduplicate field copying logic

This commit is contained in:
Sergej Jaskiewicz
2023-11-16 19:15:34 +01:00
committed by Space Team
parent 5f04bc8a27
commit 7bd4de65f8
3 changed files with 17 additions and 17 deletions
@@ -187,19 +187,12 @@ sealed class Field(
override fun copy() = internalCopy().also(::updateFieldsInCopy)
protected fun updateFieldsInCopy(copy: Field) {
copy.needAcceptAndTransform = needAcceptAndTransform
copy.useInBaseTransformerDetection = useInBaseTransformerDetection
copy.isMutable = isMutable
copy.optInAnnotation = optInAnnotation
override fun updateFieldsInCopy(copy: Field) {
super.updateFieldsInCopy(copy)
copy.baseDefaultValue = baseDefaultValue
copy.baseGetter = baseGetter
copy.customUseInIrFactoryStrategy = customUseInIrFactoryStrategy
copy.fromParent = fromParent
copy.customSetter = customSetter
copy.visibility = visibility
copy.deprecation = deprecation
copy.kDoc = kDoc
}
protected abstract fun internalCopy(): Field