-
Notifications
You must be signed in to change notification settings - Fork 2
requirements on the base class #6
Copy link
Copy link
Open
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels