Discussion:
[dart-misc] Dart Breaking Change: Enforce covariance in super-interfaces
'Leaf Petersen' via Dart Misc
2018-11-07 22:40:50 UTC
Permalink
*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
<https://github.com/dart-lang/sdk/issues/35097>, 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 <https://github.com/dart-lang/sdk/issues/35097> if
you believe that you have code which will be affected by this or are
otherwise opposed to this change.

thanks,
-leaf
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/799bbcf9-a6da-4ba0-ab06-747cff30df6f%40dartlang.org.
Loading...