Skip to content

Disallow empty arrays in maximum/minimum #391

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Oct 1, 2024

This mirrors the behavior of Arrays:
Currently:

julia> maximum(Fill(3, 0))
3

After this PR

julia> maximum(fill(3, 0))
ERROR: MethodError: reducing over an empty collection is not allowed; consider supplying `init` to the reducer

julia> maximum(Fill(3, 0))
ERROR: ArgumentError: reducing over an empty collection is not allowed; consider supplying `init` to the reducer

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.91%. Comparing base (6f61dc3) to head (d51c230).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files           8        8           
  Lines        1147     1149    +2     
=======================================
+ Hits         1146     1148    +2     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant