Scala traits internals or what needs to be recompiled
I was wondering if classes inherited from traits need to be recompiled if trait code changes, so I’ve investigated a bit traits internals - how are they represented after compilation. I’d like to share some observations.
Suppose we have file SuperTrait1.scala:
trait SuperTrait1 { def doOp1(): Unit = { println("do op1 V1") } } SuperTrait2.scala:
trait SuperTrait2 { def doOp2(): Unit = { println("do op2 V1") } } and SubClass.