Skip to content

Fasta accepts conflicting interface type arguments when contravariant #34574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
askeksa-google opened this issue Sep 25, 2018 · 3 comments
Closed
Assignees
Labels
front-end-missing-error legacy-area-front-end Legacy: Use area-dart-model instead.
Milestone

Comments

@askeksa-google
Copy link

class I<T> {}

class A {}

class B extends A {}

class X implements I<B> {}

class Y extends X implements I<A> {}

Is invalid, since Y implements two different generic instantiations of I. But Fasta does not report an error. If A and B are swapped, an error is correctly reported.

@askeksa-google askeksa-google added legacy-area-front-end Legacy: Use area-dart-model instead. front-end-missing-error labels Sep 25, 2018
@askeksa-google askeksa-google added this to the Dart2.1 milestone Sep 25, 2018
@kmillikin kmillikin self-assigned this Sep 25, 2018
@kmillikin
Copy link

This'll be fixed by https://dart-review.googlesource.com/c/sdk/+/76141

As far as I can tell, the code that allows this case was to deal with VM-style super mixins, and probably before mixin type inference was implemented.

@kmillikin
Copy link

Right, it was this P0 issue affecting Flutter: #31656

The special case was a "short-term hack" https://dart-review.googlesource.com/c/sdk/+/33884

@kmillikin
Copy link

Fixed by c9b05d3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end-missing-error legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

2 participants