gbracha / lessRestrictedMixins

Lift some, but not all, of the current restrictions on mixins in Dart.
Apache License 2.0
2 stars 2 forks source link

requirements on the base class #6

Open sigmundch opened 9 years ago

sigmundch commented 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?

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?