@@ -391,16 +391,18 @@ Base.reshape(A::OffsetArray, inds::Tuple{Colon}) = reshape(parent(A), inds)
391391# This is a stopgap solution
392392Base. permutedims (v:: OffsetVector ) = reshape (v, (1 , axes (v, 1 )))
393393
394- Base. fill (v, inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
395- fill! (similar (Array{typeof (v)}, inds), v)
396- Base. zeros (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
397- fill! (similar (Array{T}, inds), zero (T))
398- Base. ones (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
399- fill! (similar (Array{T}, inds), one (T))
400- Base. trues (inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
401- fill! (similar (BitArray, inds), true )
402- Base. falses (inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
403- fill! (similar (BitArray, inds), false )
394+ if VERSION < v " 1.12.0-DEV.343" # available in Base beyond this version
395+ Base. fill (v, inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
396+ fill! (similar (Array{typeof (v)}, inds), v)
397+ Base. zeros (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
398+ fill! (similar (Array{T}, inds), zero (T))
399+ Base. ones (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
400+ fill! (similar (Array{T}, inds), one (T))
401+ Base. trues (inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
402+ fill! (similar (BitArray, inds), true )
403+ Base. falses (inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
404+ fill! (similar (BitArray, inds), false )
405+ end
404406
405407Base. zero (A:: OffsetArray ) = parent_call (zero, A)
406408Base. fill! (A:: OffsetArray , x) = parent_call (Ap -> fill! (Ap, x), A)
0 commit comments