josephivie
03/09/2019, 6:53 AMinterface Comparator<T>
instead of interface Comparator<in T>
? Like, I know theoretically you shouldn't have to specify that the T
has in
variance, but in common code errors will be shown if you do something like interface Sort<in T>: Comparator<T>
, saying the T
in Comparator
is invariant
.ilya.gorbunov
03/11/2019, 2:09 PMComparator
interface is implemented with java.util.Comparator
which is invariant, that's why it's invariant in common too.