Open sigmundch opened 9 years ago
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?
D
B
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?
D2
If I understand correctly, on this program:
We require that
D
is a subtype ofB
(that is,D
could extend or implementB
), correct?What if
D
structurally implementsB
but doesn't declare so? For example in:Would that yield an warning? The reality is that a user could always add an extra type in the hierarchy to do this:
Which brings the question: do we want to automatically allow this so that users don't have to write
D2
?