I understand how scala addresses the diamond inheritance situation by considering the order of the traits mentioned. I am curious to understand how it solves the same issue for fields. Here is what I am trying to understand -
class A {print("A")}
trait B extends A {print("B") ; val x="b"}
trait C extends B {print("C")}
trait D extends A {print("D"); val x="d"}
object TraitsEx extends App {
var d = new A with B with D
println(d.x)
}
The above code does not compile.