I found this reading another question:
"[...] a trait that extends a class puts a restriction on what classes can extend that trait - namely, all classes that mix-in that trait must extend that class"
a little example:
class C
trait U
trait T extends C
class D extends U with T // does not work
class E extends T with U // works
Apparently when traits inherit from classes, you have to put the trait in the position that you would otherwise place a class in (i.e. directly after extends)
Now to my questions:
(extended the previous example)
class C
class Test
trait U
trait T extends C
trait Tst extends Test
class D extends U with T // does not work
class E extends T with U // works
class Test2 extends Tst with T
- what do we do when we want to inherit form two different traits, where each of those two inherit from a different class? (see class Test 2) this doesn't seem to be possible
- if we need to pay attention to the placement of traits that extend a class, how do traits work then? Are traits inheriting from classes not "normal" traits anymore?