From 95a34a902061699205d0d116878e766f1e338d20 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Thu, 25 Feb 2021 12:35:54 -0500 Subject: [PATCH] clarify non-scalar indexed assignment (#39788) Ref: #39725 Co-authored-by: Nicholas Bauer --- base/indices.jl | 2 +- doc/src/manual/arrays.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/indices.jl b/base/indices.jl index e7fc58d98c9b1..462e62c6d8883 100644 --- a/base/indices.jl +++ b/base/indices.jl @@ -259,7 +259,7 @@ function setindex_shape_check(X::AbstractArray{<:Any,2}, i::Integer, j::Integer) end setindex_shape_check(::Any...) = - throw(ArgumentError("indexed assignment with a single value to many locations is not supported; perhaps use broadcasting `.=` instead?")) + throw(ArgumentError("indexed assignment with a single value to possibly many locations is not supported; perhaps use broadcasting `.=` instead?")) # convert to a supported index type (array or Int) """ diff --git a/doc/src/manual/arrays.md b/doc/src/manual/arrays.md index 8e49e29a1508a..2afc264556713 100644 --- a/doc/src/manual/arrays.md +++ b/doc/src/manual/arrays.md @@ -470,7 +470,7 @@ overwritten with the value of `X`, [`convert`](@ref)ing to the [`eltype`](@ref) of `A` if necessary. -If any index `I_k` selects more than one location, then the right hand side `X` must be an +If any index `I_k` is itself an array, then the right hand side `X` must also be an array with the same shape as the result of indexing `A[I_1, I_2, ..., I_n]` or a vector with the same number of elements. The value in location `I_1[i_1], I_2[i_2], ..., I_n[i_n]` of `A` is overwritten with the value `X[I_1, I_2, ..., I_n]`, converting if necessary. The