Why Matrix{Float64}() is deprecated but Vector{Float64}() isn't?

Matrix{Float64}() generates a deprecation warning in Julia 0.6.0:

WARNING: Matrix{T}() is deprecated, use Matrix{T}(0, 0) instead.

But Vector{Float64}() works fine. Why one is deprecated but the other isn’t? What is the difference?

1 Like

It was discussed here: https://github.com/JuliaLang/julia/pull/20330#pullrequestreview-19245131

I think the consensus was that it would be consistent to deprecate Vector{T}() too, but that syntax is widely used so it would be very disruptive.

Shouldn’t it be deprecated now for consistency in Julia v0.7 and beyond?

1 Like

Although the PR did not get much attention, see https://github.com/JuliaLang/julia/pull/22717 where it was decided to keep it to be consistent with Set constructors.