Skip to content

Commit

Permalink
Fix setindex! to return its first argument
Browse files Browse the repository at this point in the history
  • Loading branch information
emmt committed Feb 18, 2021
1 parent 5403d8d commit 9ccbe78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/StructuredArrays.jl
Expand Up @@ -300,16 +300,19 @@ end
@boundscheck checkbounds(A, i)
(i == length(A) == 1) || not_all_elements()
A.val = x
A
end

@inline function Base.setindex!(A::MutableUniformArray, x,
i::AbstractUnitRange{<:Integer})
(first(i) == 1 && last(i) == length(A)) || not_all_elements()
A.val = x
A
end

@inline function Base.setindex!(A::MutableUniformArray, x, ::Colon)
A.val = x
A
end

"""
Expand Down

0 comments on commit 9ccbe78

Please sign in to comment.