It’s because in
A with B
, ifA
is a trait, the list of parents is extended to include the supertype ofA
, as per 5.1 in the spec.
But why the difference between new A with B
and new A
? Why not let new A
mean new Object with A
if A
is a trait?
From a user’s perspective this irregularity is unexpected and confusing:
trait A
trait B
trait C
trait D
new A with B with C with D
new A with B with C
new A with B
new A {}