merge

infix inline fun <T : Any> T.merge(other: T): T

Infix function that merges two instances of a generic class T

Return

merged form of this and other, where the properties of this take precedence over other

Credit to https://stackoverflow.com/questions/44566607/combining-merging-data-classes-in-kotlin/44570679#44570679

Parameters

other