TL;DR: There is a missing check on the uses of covariant generic parameters in super-interfaces that can be used to violate soundness (and hence memory safety) in Dart programs. We are proposing to add this missing check as a static error in an upcoming release of Dart. We have not found any code which would be affected by this new error, but it is possible that some existing working code will break.
A detailed description of the proposed change can be
found here, but in short, we propose to make it an error to use a type parameter of a class in a contravariant or invariant position in any of the classes direct super-interfaces.
This code would become an error after this change:
class A<X> {};
class B<X> extends A<void Function(X)> {};
Please comment on
this issue if you believe that you have code which will be affected by this or are otherwise opposed to this change.
thanks,
-leaf