Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jw3126 committed Mar 29, 2017
1 parent e5f8659 commit 6b4f531
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1304,10 +1304,11 @@ for f in (:ones, :zeros)
@eval ($f)(T::Type, i::Integer) = ($f)(T, (i,))
@eval function ($f){T}(::Type{T}, arr::Array{T})
msg = string("`", $f , "{T}(::Type{T}, arr::Array{T})` is deprecated, use ",
"`", $f , "(T, size(arr))` instead.",
"`", $f , "(T, size(arr))` instead. ",
"A `MethodError` will be thrown."
)
error(msg)
Base.depwarn(msg, Symbol($f))
throw(MethodError($f, (T, arr)))
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ end
test_zeros(zs, SparseMatrixCSC{Complex{Float64}}, (2, 3))

# #19265"
@test_throws Exception zeros(Float64, [1.])
@test_throws MethodError zeros(Float64, [1.])
x = [1.]
test_zeros(zeros(x, Float64), Vector{Float64}, (1,))
@test x == [1.]
Expand Down

0 comments on commit 6b4f531

Please sign in to comment.