renggli/dart-more

Multiset difference method should take Iterable<Object?> as argument

Wikiwix opened this issue · 1 comments

Multiset's difference function takes Iterable` which was fine before null safety. But with null safety this unnecessarily limits the uses.
For example

Multiset<E> diffSample<E>(Multiset<E> multiset, Iterable<E> iterable) =>  multiset.difference(iterable);

will fail unless you force E to extend from Object.

I guess this logic will apply to other collection related code, but did not search for them.

Thank you for reporting, let me know if you spot other cases.