I have an outdated message on my system, and I would like to be able to display a new version of the message on my system.
Why can't I overload the case class?
case class Message(a:Int, b:Int) case class NewMessage(a:Int, b:Int, c:Int) { def this(msg : Message) = this(a = msg.a, b = msg.b, c = 0) } val msg = Message(1,2) val converted = NewMessage(msg)
This code does not seem to compile. :(
source share