Here's a really clear explanation from Ladislav Thon :
[...] there is a simple tip that is actually semantically correct: in the class of declaration C, SC continues with M1, M2, M3 implements I1, I2 {...}, imagine the brackets around the contents of the extensions clause. They will look like this: the class C extends (SC with M1, M2, M3) implements I1, I2 {...}. This means that class C does not extend SC; it extends SC_with_M1_with_M2_with_M3.
Or, in another way: a class declaration has an extends clause and an implements clause, but does not have a with clause. Instead, the with clause belongs inside the extends clause.
And one more point from Florian Loich :
When you extend "Object" with mixin, the first mixin can always replace "Object".
So your class B with A should be class B extends Object with A , which is also equivalent to class B extends A
Alexandre Ardhuin
source share