Apologies if dup.
julia> mutable struct Foo
end
julia> Base.zero(::Type{Foo}) = Foo()
julia> x = zeros(Foo, 2)
2-element Array{Foo,1}:
Foo()
Foo()
julia> x[1] === x[2]
true
I would've expected each element to have been instantiated separately via a new zero call. If I wanted this behavior, I would've just called fill(zero(Foo), 2).
see jump-dev/JuMP.jl#1456 (comment)
obligatory xref to #24595