Skip to content

Commit 4702b57

Browse files
committed
Fix corner case in zero-dim broadcast
1 parent 55ff45a commit 4702b57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blocksparsearrayinterface/broadcast.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ end
4040
# If the RHS is zero, this makes sure that the storage is emptied,
4141
# which is logic that is handled by `fill!`.
4242
function copyto_blocksparse!(dest::AbstractArray, bc::Broadcasted{<:AbstractArrayStyle{0}})
43-
value = bc.f(bc.args...)
43+
# `[]` is used to unwrap zero-dimensional arrays.
44+
value = bc.f(bc.args...)[]
4445
return @interface BlockSparseArrayInterface() fill!(dest, value)
4546
end
4647

0 commit comments

Comments
 (0)