Skip to content

Inconsistencies in the Spec about class #23318

Open
@fare

Description

@fare
  1. The Scala 3.4 specification uses the word "class" inconsistently, sometimes meaning "that Java-inherited concept that only supports single inheritance", sometimes meaning "class or trait". Please be consistent in the specification if nowhere else. Maybe introduce and systematically use a word for class-or-trait; or declare that class (or trait) encompasses both unless specified otherwise ("non-class trait" if trait encompasses both, "non-trait class" if class encompasses both), and use it consistently afterwards. It's a spec, it must be precise.
  2. The Scala 3.4 specification fails to explain that the most-specific superclass (if not Object) need not appear first among the direct super classes-or-traits of a class-or-trait, whereas it needed to in Scala 2.
  3. While we're at it, it really sucks that you use a variant of the LOOPS algorithm for class-or-trait linearization, instead of C3. For why the consistency constraints of C3 matter, see the 1992 and 1994 articles by Ducournau, Habib, Huchard, and Mugnier. I realize this breaks backward compatibility and thus may have to wait until a new major Scala version, though.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions