[Chapel Merge] Manually disable catch-all min()/max() overloads f

Branch: refs/heads/main
Revision: aa0b063
Author: bradcray
Link: Manually disable catch-all min()/max() overloads for arrays by bradcray · Pull Request #19288 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19288 from bradcray/disable-gen-min-max-for-arrays

Manually disable catch-all min()/max() overloads for arrays

[reviewed by @mppf]

Our catch-all min/max overloads don't work when promoted due
to the lack of support for promoted conditionals in Chapel; but if
they're disabled for arrays, things work as you'd expect (by promoting
the scalar versions designed for specific types). So here, I disable
array arguments from falling into the general min/max case to permit
elementwise min/max on arrays.

In undertaking this, I considered broadening the filter to look for other
promotable types like ranges and domains, but (a) I didn't have any good
motivation for adding support for those cases (e.g., max(1..10, 0..9)
doesn't seem like an interesting computation, and while
max(-10..10 by 2, -5..5) is a bit more interesting, it's not much), and
(b) I wasn't sure where to draw the line (e.g., I could imagine a user type
that supported promotion but also supported comparison operators).
So this felt like a simple, obvious step forward where additional refinements
may want to be made over time.

This makes me wonder a bit about what more we could do as
language/library designers to make such catch-all overloads more
constrained; or what practices we should use as library developers
to avoid such cases.

Modified Files:
A test/library/standard/Math/minMaxArr.chpl

A test/library/standard/Math/minMaxArr.good
M modules/standard/Math.chpl

Compare: https://github.com/chapel-lang/chapel/compare/5d64165443f2...aa0b0639d523