Scala 3's multiple inheritance is a bit different from Scala 2's. It feels quirky in the context of Scala 2, but the rules are easier to understand. Traits can now take parameters, but you're only allowed to apply them in the extends clause of a class (not another trait).
-
-
Hoping that gets reverted
-
Really, why? Because it's performing a function too similar to `&` and `with`?
- Show replies
New conversation -
-
-
And something changed around self types. If X refers to Y members you can say: trait X { this: Y => … } but if X implements any of Y you must say: trait X extends Y { … }.
-
That's very interesting, and I never saw the relation ro self-types before, but it seems like "parameterless trait inheritance" is very much like a self-type, except that if the trait is parameterless anyway, it's inherited... Thanks for the hint!
- Show replies
New conversation -
-
-
I don't really understand the reason for trait parameters other then allowing context bounds / implicits on the type parameters. Also I was never find of extending case classes either. Something about it feels wrong. Like mixing types and values in the wrong way.
-
Would love to see a usecase that makes sense for this.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.