[Chapel Merge] Work around a bug in orderedSet

Branch: refs/heads/main
Revision: 9151289
Author: e-kayrakli
Link: Work around a bug in orderedSet by e-kayrakli · Pull Request #18661 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18661 from e-kayrakli/orderedSet-bug-fix

Work around a bug in orderedSet

This PR works around a bug in OrderedSet.

Resolves Similar ordered sets with different comparators · Issue #18656 · chapel-lang/chapel · GitHub

The bug in question is captured in
Similar ordered sets with different comparators · Issue #18656 · chapel-lang/chapel · GitHub.

The solution for the bug is to make the internal treap field use ? for the
generic comparator field. Doing that caused some issue in & and &= operators
because now, that field is generic to the compiler, and it cannot split-init
with these operators' implementations. The solution for that is explicit
initialization.

Then that posed the question "if I am &'ing two orderedSets, how do we determine
the comparator of the resulting orderedSet?" For now, we use the first operand's
comparator.

[Mostly trivial, but discussed with @rapiz1 and @cassella]

Test: