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?
If I understand correctly, on this program:
We require that
Dis a subtype ofB(that is,Dcould extend or implementB), correct?What if
Dstructurally implementsBbut 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?