Skip to content

requirements on the base class #6

@sigmundch

Description

@sigmundch

If I understand correctly, on this program:

class A extends B {}
class C extends D with A {}

We require that D is a subtype of B (that is, D could extend or implement B), correct?

What if D structurally implements B but doesn't declare so? For example in:

class B { get x; }
class D { get x; }

Would that yield an warning? The reality is that a user could always add an extra type in the hierarchy to do this:

class D2 extends D implements B {}
class C extends D2 with A {}

Which brings the question: do we want to automatically allow this so that users don't have to write D2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions