Skip to content

Commit 5db70d1

Browse files
committed
Fix setting zero dimensional block
1 parent 004403d commit 5db70d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blocksparsearrayinterface/blocksparsearrayinterface.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ end
157157
a::AbstractArray{<:Any,0}, value, I::BlockIndex{0}
158158
)
159159
a_b = blocks(a)[]
160-
a_b[] = value
160+
# `value[]` handles scalars and 0-dimensional arrays.
161+
a_b[] = value[]
161162
# Set the block, required if it is structurally zero.
162163
blocks(a)[] = a_b
163164
return a

0 commit comments

Comments
 (0)