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
Native extrema evaluate unused fallback and key arguments #910
The native extrema functions evaluate arguments that the canonical stdlib leaves unused. Reproduced on master 567b61ac4a6c23546a62d79324bb4aaed6bdc941:
std.minArray([2, 1], onEmpty=error'unused')
This reports RUNTIME ERROR: unused instead of returning 1. maxArray has the same problem. Empty arrays also evaluate an unused keyF even when onEmpty is provided, and singleton arrays invoke a key function that cannot affect the result.
The canonical minArray/maxArray definitions only evaluate onEmpty for empty input and only use keyF when comparing elements. A native call adapter can preserve those conditions while retaining the optimized extrema algorithms and explicit tailstrict argument forcing.
Regression cases fail on current production code; a focused fix passes unused-argument cases, ordinary extrema, empty-input errors, and explicit tailstrict checks.
Opened #913 with a native call adapter that keeps unused fallbacks and keys lazy while retaining the existing extrema algorithms. Explicit tailstrict forces both provided arguments and the implicit error default, with provided-argument errors retaining their order.
Ten regression cases fail against the original code and pass with the fix. The focused tests and full Linux Go suite pass; the PR records the remaining Bazel/C/Python integration checks.
Activity
vinsymoyya commentedon Nov 14, 2026
Opened #913 with a native call adapter that keeps unused fallbacks and keys lazy while retaining the existing extrema algorithms. Explicit
tailstrictforces both provided arguments and the implicit error default, with provided-argument errors retaining their order.Ten regression cases fail against the original code and pass with the fix. The focused tests and full Linux Go suite pass; the PR records the remaining Bazel/C/Python integration checks.