Files
swift-collections/Sources/SortedCollections/SortedSet
Aniket 0d731a673c SortedSet: generalize set operations to arbitrary Sequences
SortedSet's set operations only accepted another SortedSet, so
SortedSet([1, 2]).union(0 ..< 10) did not compile and the type could
not conform to SetAPIChecker.

Add the customary Sequence generalizations for all 13 operations,
keeping the existing Self overloads as the fast path (concrete beats
generic in overload resolution). Arbitrary sequences fall back through
a temporary SortedSet or, for the membership predicates, allSatisfy.

Fixes #743.

Signed-off-by: Aniket <aniketkomailkro@gmail.com>
2026-09-30 03:14:10 -07:00
..