Given two independent traits:
trait T1 {
def x = 42
}
trait T2 {
def x = 0
}
If I try to define a class mixing in these two traits like:
class C extends T1 with T2
I get a compiler error:
error: overriding method x in trait T1 of type => Int;
method x in trait T2 of type => Int needs `override' modifier
class C extends T1 with T2
^
one error found
Now suppose T1 and T2 have been developed independently, hence no override as they do not override anything. How can C be defined then? Like this:
class C extends T1 with T2 {
override def x = super.x
}
?