| | |
Summary: CZ: Multiple Inheritance Without Diamonds
Donna Malayeri
Carnegie Mellon University
donna@cs.cmu.edu
Jonathan Aldrich
Carnegie Mellon University
aldrich@cs.cmu.edu
Abstract
Multiple inheritance has long been plagued with the "dia-
mond" inheritance problem, leading to solutions that restrict
expressiveness, such as mixins and traits. Instead, we ad-
dress the diamond problem directly, considering two diffi-
culties it causes: ensuring a correct semantics for object ini-
tializers, and typechecking multiple dispatch in a modular
fashion--the latter problem arising even with multiple inter-
face inheritance. We show that previous solutions to these
problems are either unsatisfactory or cumbersome, and sug-
gest a novel approach: supporting multiple inheritance but
forbidding diamond inheritance. Expressiveness is retained
through two features: a "requires" construct that provides
|