Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #29266, better error message for deprecated scalar-fill indexed assignment #31085

Merged
merged 4 commits into from
Jun 25, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a specific error message for #29266
  • Loading branch information
dourouc05 committed Feb 15, 2019
commit 1455dc53caced935fc07272d201a89f1aecebbf9
3 changes: 3 additions & 0 deletions base/indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ function setindex_shape_check(X::AbstractArray{<:Any,2}, i::Integer, j::Integer)
end
end

setindex_shape_check(::Any...) =
throw(ArgumentError("Scalar assignment to a vector is not supported: maybe you wanted to use `.=`?"))
dourouc05 marked this conversation as resolved.
Show resolved Hide resolved

# convert to a supported index type (array or Int)
"""
to_index(A, i)
Expand Down