Multiple Parent Types: How to go about it?

This has been addressed in some of the discussions linked above, but maybe it helps to reiterate that

  1. Julia does not have “inheritance” of fields, either single or multiple, and probably never will.

  2. Types have supertypes. Supertypes are always abstract. This is useful for dispatch, mostly, and it should be thought of as a convenience feature that could be implemented with eg traits if we didn’t have it.

  3. Traits are a special case of type stable mappings that allow implementing multiple supertype-like relations, among other things. But they are much more general than that, and mesh well with how Julia works.

1 Like