Closed
Description
Functions like E firstWhere(bool test(E element), {E orElse()?})
have an invariant E
return type.
Considering the fact that E
extends E?
, and orElse
can usefully return null
, I suspect a covariant contravariant T super E
may be a more useful return type. (I'm not sure how to express this in Dart though).
What do you think?