Is that a bug?
julia> using ZeroDimensionalArrays, FillArrays
julia> fill(1) .+ 1
2
julia> Fill(1) .+ 1
0-dimensional Fill{Int64}, with entry equal to 2
julia> ZeroDimArray(1) .+ 1
2
Edit, found my issue about this. Original example was:
julia> real(fill(1+im)) # returns an array
0-dimensional Array{Int64, 0}:
1
julia> real(Fill(1+im)) # returns an array of arrays
0-dimensional Array{Fill{Int64, 0, Tuple{}}, 0}:
Fill(1)
But there’s another broadcasting difference, that Fill makes purity assumptions. This one I think is a choice, which FillArrays.jl does not regard as a bug:
julia> (_ -> rand()).(fill(1)) .+ zeros(2,3) # ordinary fused broadcast
2×3 Matrix{Float64}:
0.720996 0.162743 0.170527
0.217833 0.417129 0.955952
julia> (_ -> rand()).(Fill(1)) .+ zeros(2,3) # calls rand just once
2×3 Matrix{Float64}:
0.72484 0.72484 0.72484
0.72484 0.72484 0.72484
julia> (_ -> rand()).(ZeroDimArray(1)) .+ zeros(2,3)
2×3 Matrix{Float64}:
0.0791902 0.467466 0.74044
0.06619 0.701926 0.531931