Skip to content

Commit 74aaeeb

Browse files
authored
ReadOnly fixes: prevent adding some methods of size, axes, eltype (#649)
1 parent b823108 commit 74aaeeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/readonly.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ ReadOnly(x::ReadOnly) = x
1313
Base.getproperty(x::ReadOnly, s::Symbol) = Base.getproperty(parent(x), s)
1414
@inline Base.parent(x::ReadOnly) = getfield(x, :parent)
1515

16-
for i in [:length, :first, :last, :eachindex, :firstindex, :lastindex, :eltype]
16+
for i in [:length, :first, :last, :eachindex, :firstindex, :lastindex, :axes, :size]
1717
@eval Base.@propagate_inbounds @inline Base.$i(x::ReadOnly) = Base.$i(parent(x))
1818
end
19-
for i in [:iterate, :axes, :getindex, :size, :strides]
19+
for i in [:iterate, :getindex, :strides]
2020
@eval(Base.@propagate_inbounds @inline Base.$i(x::ReadOnly, y...) = Base.$i(parent(x), y...))
2121
end
2222

0 commit comments

Comments
 (0)