I just noticed we have these constructors:
Array{T,N}(::Nothing, d...) where {T,N} = fill!(Array{T,N}(undef, d...), nothing)
Array{T,N}(::Missing, d...) where {T,N} = fill!(Array{T,N}(undef, d...), missing)
Array{T}(::Nothing, d...) where {T} = fill!(Array{T}(undef, d...), nothing)
Array{T}(::Missing, d...) where {T} = fill!(Array{T}(undef, d...), missing)
The odd thing about these is you have to specify an element type, even though there's only one thing it could be --- e.g. you must write Array{Nothing}(nothing, m, n). I propose we do at least one of the following:
fill instead.MyArray(repeated(x), ...) can be used to construct any array filled with any value.+1 for deleting those methods in favor of fill
True, Array{Union{T,Nothing}}(nothing, ...) makes more sense.
+1 for deleting those methods in favor of fill
Never thought I'd see the day 馃槀
True, Array{Union{T,Nothing}}(nothing, ...) makes more sense.
Yes, that's the whole point of defining these constructors, as fill(nothing, n) returns a Vector{Nothing}, which is very rarely needed. And we don't really want people to use Array{Union{T, Nothing}}(undef, n) instead, whose behavior varies depending on whether T is a bits type. So I think we should keep them.
Most helpful comment
Never thought I'd see the day 馃槀