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).
No, you can't use `&`. It needs to be something different because the order of inheritance is significant, whereas `&` doesn't imply any order (in other uses). I hope `with` gets phased out instead—I think that's the plan, anyway.
-
-
I don't think `with` can be phased out because of ambiguity with tuples. e.g. trait X; object X def x = (new X, X) Is it `x: X` or `x: (X, X.type)` ? So I hope `,` gets reconsidered as an ill-thought-out experiment :P
-
That's annoying... But there's more than one way to create a tuple... (new X) *: X *: () It would seem a shame to require a whole keyword to work around an ambiguity which already has an alternative. But I guess I just never liked seeing `with` five times in a row.
- 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.