Let's say I have two case classes:
case class C1(a: Int, b: String)
case class C2(a: Int, b: String, c: Long = 0)
I want to convert instance of C1 to C2 and then set additional field c
. I found out the following solution:
C1.unapply(C1(1, "s1")).map(v => C2(v._1, v._2, 7l))
But specifying parameters one by one is not applicable, because real case class will have at least 15 params. Any ideas how to solve it?