Skip to content

Typo in the "is a superclass" relation #25839

@kmillikin

Description

@kmillikin

@gbracha In section 10.9 (3rd edition), we have:

It is a compile-time error if a class C is a superclass of itself.

And just above that is the definition of the "is a superclass" relation:

A class S is a superclass of a class C iff either:
• S is the superclass of C, or
• S is a superclass of a class S0 and S0 is a superclass of C.

This admits reflexive relations. An implementation that tries to check if C is a superclass of itself using the second case of the definition will get that C is a superclass of itself iff. C is a superclass of itself (by choosing C for the class S0).

We should disallow such compile-time errors unless there is really a transitive chain of "the superclass" from C to C. The second clause should be changed to:

• S is a superclass of a class S0 and S0 is the superclass of C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions