Skip to content

Commit c157e5d

Browse files
nsajkoKristofferC
authored andcommitted
ReadOnly: slightly restrict the dispatch on the setindex! method (#652)
(cherry picked from commit 15ec056)
1 parent 6a91bcc commit c157e5d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/readonly.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
Base.unsafe_convert(x::Type{Ptr{T}}, A::ReadOnly) where T = Base.unsafe_convert(x, parent(A))
2424
Base.elsize(::Type{ReadOnly{T,N,V}}) where {T,N,V} = Base.elsize(V)
25-
Base.@propagate_inbounds @inline Base.setindex!(x::ReadOnly, v, ind...) = if v == getindex(parent(x), ind...)
25+
Base.@propagate_inbounds @inline Base.setindex!(x::ReadOnly, v, ind::Vararg{Integer}) = if v == getindex(parent(x), ind...)
2626
v
2727
else
2828
error("Can't change $(typeof(x)).")

0 commit comments

Comments
 (0)