Skip to content

Commit dba0929

Browse files
committed
wip
[ci skip]
1 parent 9324b5a commit dba0929

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

base/broadcast.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,8 @@ Base.@propagate_inbounds dotview(B::BitArray, i::BitArray) = BitMaskedBitArray(B
828828

829829
Base.show(io::IO, B::BitMaskedBitArray) = foreach(arg->show(io, arg), (typeof(B), (B.parent, B.mask)))
830830
broadcast!(::typeof(identity), B::BitMaskedBitArray, b::Bool) = fill!(B, b)
831-
broadcast!(f, B::BitMaskedBitArray, args...) = broadcast!(f, SubArray(B.parent, to_indices(B.parent, (B.mask,))), args...)
831+
broadcast!(f::Tf, B::BitMaskedBitArray, As::Vararg{Any,N}) where {Tf,N} =
832+
broadcast!(f, SubArray(B.parent, to_indices(B.parent, (B.mask,))), As...)
832833
function Base.fill!(B::BitMaskedBitArray, b::Bool)
833834
Bc = B.parent.chunks
834835
Ic = B.mask.chunks

base/deprecated.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,10 @@ function lastindex(a, n)
14021402
end
14031403

14041404
# PR
1405+
_axes(::Ref) = ()
1406+
_axes(x) = axes(x)
14051407
function deprecate_scalar_setindex_broadcast_message(v, I...)
1406-
value = (Broadcast.BroadcastStyle(typeof(v)) === Broadcast.Scalar() ? "x" : "(x,)")
1408+
value = (_axes(Base.Broadcast.broadcastable(v)) == () ? "x" : "(x,)")
14071409
"using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= $value` instead."
14081410
end
14091411
deprecate_scalar_setindex_broadcast_message(v, ::Colon, ::Vararg{Colon}) =

stdlib/SparseArrays/src/sparsematrix.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,17 +2522,17 @@ function _spsetnz_setindex!(A::SparseMatrixCSC{Tv}, x::Tv,
25222522
end
25232523

25242524
setindex!(A::SparseMatrixCSC{Tv,Ti}, S::Matrix, I::Integer, J::Integer) where {Tv,Ti} = setindex!(A, convert(Tv, S), I, J)
2525-
setindex!(A::SparseMatrixCSC{Tv,Ti}, S::Matrix, I::Union{Integer, AbstractVector{T}}, J::Union{Integer, AbstractVector{T}}) where {Tv,Ti,T<:Integer} =
2525+
setindex!(A::SparseMatrixCSC{Tv,Ti}, S::Matrix, I::Union{Integer, AbstractVector{<:Integer}}, J::Union{Integer, AbstractVector{<:Integer}}) where {Tv,Ti} =
25262526
setindex!(A, convert(SparseMatrixCSC{Tv,Ti}, S), I, J)
25272527

25282528
setindex!(A::SparseMatrixCSC, v::AbstractVector, I::Integer, J::Integer) = setindex!(A, convert(Tv, v), I, J)
2529-
setindex!(A::SparseMatrixCSC, v::AbstractVector, I::Union{Integer, AbstractVector{T}}, J::Union{Integer, AbstractVector{T}}) where {T<:Integer} =
2529+
setindex!(A::SparseMatrixCSC, v::AbstractVector, I::Union{Integer, AbstractVector{<:Integer}}, J::Union{Integer, AbstractVector{<:Integer}}) =
25302530
setindex!(A, reshape(v, length(I), length(J)), I, J)
25312531

2532-
# A[I,J] = B
2532+
# Nonscalar A[I,J] = B
25332533
setindex!(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}, I::Integer, J::Integer) where {Tv,Ti} =
25342534
setindex!(A, convert(Tv, I, J), I, J)
2535-
function setindex!(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}, I::Union{Integer, AbstractVector{T}}, J::Union{Integer, AbstractVector{T}}) where {Tv,Ti,T<:Integer}
2535+
function setindex!(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}, I::Union{Integer, AbstractVector{<:Integer}}, J::Union{Integer, AbstractVector{<:Integer}}) where {Tv,Ti}
25362536
if size(B,1) != length(I) || size(B,2) != length(J)
25372537
throw(DimensionMismatch(""))
25382538
end

0 commit comments

Comments
 (0)