Class-to-class inheritance is always single-inheritance, so there's never any ambiguity when applying the value parameters, though there may still be a need to resolve conflicts in concrete implementations.
-
Show this thread
-
A new error will occur with code like this: trait Foo(x: Int) trait Bar extends Foo // not allowed to extend Foo(0)! class Baz() extends Bar We are told that we need to explicitly specify the inheritance of Foo with its parameter, like so: class Baz() extends Bar, Foo(0)
1 reply 0 retweets 2 likesShow this thread -
You also get to use commas to separate the list of inherited traits.
3 replies 0 retweets 2 likesShow this thread -
-
Replying to @kai_nyasha
Really, why? Because it's performing a function too similar to `&` and `with`?
1 reply 0 retweets 0 likes -
Replying to @propensive
Well yeah, because there's already `with`. I think you can't use `&` in extends clause.
1 reply 0 retweets 0 likes -
Replying to @kai_nyasha
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.
1 reply 0 retweets 0 likes -
Replying to @propensive
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
2 replies 0 retweets 2 likes -
Replying to @kai_nyasha @propensive
What if you had to be explicit about anonymous classes: new _ extends X, X It just feels like the existing syntax is not very self descriptive
1 reply 0 retweets 0 likes -
Replying to @AlanJay1 @kai_nyasha
I think I would prefer that. If it could be done so that the anonymous class syntax doesn't need to use the `new` keyword too (reuse `object`, maybe?) that would be good. Right now it feels like we tried to eliminate some keywords, but we failed so they're still there...
1 reply 0 retweets 0 likes
And instead of simplifying the language, it's just created a new corner case...
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.