You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Range unions implement IComparable<T> but not IComparable, so non-generic sorts throw #225
The range unions implement IComparable<TRange> (#39) but not the non-generic IComparable. So List<IRange<int>>.Sort(), ArrayList.Sort() and any non-generic consumer (data grids, Comparer.Default) throw "At least one object must implement IComparable", although the docs say List.Sort() works with no comparer. A list of the concrete type, including List<Int32Range.Finite> through contravariance, works. Found by the pre-tag analysis (#179). It fails loudly.
Decision (maintainer, 2026-10-18)
Add the non-generic IComparable in 10.0.0 as part of #39's surface. It delegates to the same RangeOrder. A null argument sorts first, the same as the generic form. An argument that isn't the same range type throws ArgumentException.
Done when
Every range union (and RangeSet, if it has IComparable<RangeSet<…>>) implements IComparable. A discovered test holds that it agrees with IComparable<T> for every ordered shape pair and that a foreign argument throws. The docs' sorting sentence is true for List<IRange<T>>.
Activity