Skip to content

Commit 5b2d5c6

Browse files
committed
Fix setindex! after API changes in Base
1 parent 8e16562 commit 5b2d5c6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/darray.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,16 +667,17 @@ import Base: checkbounds_indices
667667
# the local portion of the source array
668668
function Base.setindex!(a::Array, s::SubDArray,
669669
I::Union{UnitRange{Int},Colon,Vector{Int},StepRange{Int,Int}}...)
670-
Base.setindex_shape_check(s, Base.index_lengths(a, I...)...)
671-
n = length(I)
670+
Inew = Base.to_indices(a, I)
671+
Base.setindex_shape_check(s, Base.index_lengths(Inew...)...)
672+
n = length(Inew)
672673
d = s.parent
673-
J = Base.decolon(d, s.indexes...)
674+
J = Base.to_indices(d, s.indexes)
674675
@sync for i = 1:length(d.pids)
675676
K_c = d.indexes[i]
676677
K = map(intersect, J, K_c)
677678
if !any(isempty, K)
678679
K_mask = map(indexin_mask, J, K_c)
679-
idxs = restrict_indices(Base.decolon(a, I...), K_mask)
680+
idxs = restrict_indices(Inew, K_mask)
680681
if isequal(K, K_c)
681682
# whole chunk
682683
@async a[idxs...] = chunk(d, i)

0 commit comments

Comments
 (0)