How to avoid scala's case class default toString function being overridden?

tribbloid picture tribbloid · Dec 14, 2014 · Viewed 10.5k times · Source

Scala case class has a default toString function. But when this case class extends a trait with an existing toString() function, it will be rendered useless. How can I prevent this situation?

Answer

tribbloid picture tribbloid · Dec 14, 2014

OK here is the easist answer:

override def toString = ScalaRunTime._toString(this)

end of story:)