As a brief note today, here’s an example of stackable modifications in Scala.
What is ‘super’ in Scala when you mix in traits?
Lately I was curious about what
super means when you mix Scala traits into a class or object. A simplified answer is that
super refers to the last trait that’s mixed in, though I should be careful and note that this is an oversimplification.
This can be demonstrated in an example that uses both inheritance and mixins with traits. Given this combination of traits and classes: