= Solution
Read each <Scala trait linearization> from the most specific implementation toward the base. For a declaration with parents $P_1,\ldots,P_r$, concatenate their linearizations from right to left, deleting a duplicate from a left operand when it already occurs in the right operand. This can move a repeated ancestor later than a superficial “rightmost trait first” scan suggests. Omitting the common `AnyRef, Any` suffix, the answers are
``
C, Y, H, N, L, I, E
B, Y, H, N, L, D, I, E
A, N, O, Y, S, H, T, L, D, I, E
``
For example, `T` contributes `T,L,D,I,E`, while `O` contributes `O,Y,S,H,E`. In `A`, the separately mentioned `Y` also appears in the later merge with `O`, and `N`'s ancestors also occur in `T`; resolving these duplicates yields the final order displayed above. \b[The inherited trait orders are the displayed lists after removing their leading class names.] <Scala 2.11 classes and objects specification>[Class Linearization]{ref}
Back to article page