CZ: multiple inheritance without diamonds

  • Authors:
  • Donna Malayeri

  • Affiliations:
  • Carnegie Mellon University, Pittsburgh, PA, USA

  • Venue:
  • Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Multiple inheritance has long been plagued with the "diamond" inheritance problem, spurring a variety of solutions, such as virtual inheritance, mixins and traits. We offer a different solution: a language that supports multiple inheritance but forbids diamond inheritance. We maintain expressiveness through a "requires" construct (inspired by Scala) that provides subtyping without inheritance diamonds. Our novel no-diamond restriction offers the benefit of allowing multiple inheritance to co-exist neatly with fields, without resorting to tactics such as virtual inheritance. We believe our solution is more expressive than previous attempts to solve the diamond inheritance problem.