[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
@@ -87,4 +87,17 @@ abstract class AbstractField<Field : AbstractField<Field>> {
* Returns a copy of this field.
*/
abstract fun copy(): Field
protected open fun updateFieldsInCopy(copy: Field) {
copy.kDoc = kDoc
copy.arbitraryImportables += arbitraryImportables
copy.optInAnnotation = optInAnnotation
copy.isMutable = isMutable
copy.deprecation = deprecation
copy.visibility = visibility
copy.fromParent = fromParent
copy.useInBaseTransformerDetection = useInBaseTransformerDetection
copy.needAcceptAndTransform = needAcceptAndTransform
copy.overriddenTypes += overriddenTypes
}
}