Skip to content

Commit 15ec056

Browse files
authored
ReadOnly: slightly restrict the dispatch on the setindex! method (#652)
1 parent 306605d commit 15ec056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)