def and var in traits on Scala 2.12, 2.13 and 3.0.0
Scala traits should define defs, because “A val can override a def, but a def cannot override a val” (via Alvin Alexander via StackOverflow). But it’s interesting to look at how the compiler treats that. Alvin Alexander did that, but only for Scala 2.12.8. Let’s have a look at 2.12, 2.13 and the just released 3.0 (formerly known as dotty). ...