Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FillArrays"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.13.0"
version = "1.13.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
6 changes: 5 additions & 1 deletion src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,11 @@ end
#########

for op in (:maximum, :minimum)
@eval $op(x::AbstractFill) = getindex_value(x)
@eval function $op(x::AbstractFill)
length(x) == 0 && throw(ArgumentError(
"reducing over an empty collection is not allowed; consider supplying `init` to the reducer"))
getindex_value(x)
end
end


Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,9 @@ end
@test_throws MethodError issorted(Fill(im, 2))
@test_throws MethodError sort(Fill(im, 2))
@test_throws MethodError sort!(Fill(im, 2))

@test_throws ArgumentError maximum(Fill(3, 0))
@test_throws ArgumentError minimum(Fill(3, 0))
end

@testset "Cumsum, accumulate and diff" begin
Expand Down