An inheritance hierarchy between traits will be "parameterless" inheritance, so the linearization order is not so significant, and the type system now provides a sound way to combine multiple transitive inheritances of the same trait (which may have different type parameters).
-
-
Show this thread
-
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)
Show this thread -
You also get to use commas to separate the list of inherited traits.
Show this thread
End of conversation
New conversation -
-
-
@threadreaderapp please unroll#scala3#inheritance - 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.