new Base with One with Two {} foo ( new One with Two {} foo), " " . Two foo, foo (One), foo (Base).
new Foo with One with Two {} bar ( new One with Two {} bar), " " - Base- > Foo- > One- > Two. bar, Two bar One bar. foo bar, foo (Base).
UPDATE
, @Dima.
trait Base { def foo = "Base" }
trait Foo extends Base { def bar = foo + " <: " + super.foo }
trait One extends Foo { override def bar = super.bar
override def foo = "One" }
trait Two extends Foo { override def bar = super.bar
override def foo = "Two" }
new One with Two {} bar // no Base or Foo needed
, , : res0: String = Two <: Base
Two bar (One), bar (foo), foo (not bar) .
bar foo. Two foo , One.foo .
.
trait B { def id = "B" }
trait V extends B { override def id = "V" }
trait W extends B { override def id = "W" }
trait X extends B { override def id = "X" }
trait Y extends B { override def id = "Y" }
trait Z extends B { override def id = "Z" }
trait R extends B { override def id = "R"; def mySup = super.id }
.
val r = new V with Y with W with R with X {}
val r = new W with R with Z with X with V {}
val r = new R with Y with V with B with W {}
val r = new Z with Y with X with W with R {}
r.id , r.mySup , R ( B, R).