@@ -119,9 +119,6 @@ function Base.similar(A::AbstractArray, ::Type{T}, inds::Tuple{OffsetAxis,Vararg
119119 OffsetArray (B, map (indexoffset, inds))
120120end
121121
122- Base. similar (:: Type{T} , shape:: Tuple{OffsetAxis,Vararg{OffsetAxis}} ) where {T<: AbstractArray } =
123- OffsetArray (T (undef, map (indexlength, shape)), map (indexoffset, shape))
124-
125122if VERSION < v " 0.7.0-DEV.5242"
126123# Reshape's methods in Base changed, so using the new definitions leads to ambiguities
127124Base. reshape (A:: AbstractArray , inds:: Tuple{UnitRange,Vararg{UnitRange}} ) =
147144if VERSION < v " 0.7.0-DEV.4873"
148145 # Julia PR #26733 removed similar(f, ...) in favor of just using method extension directly
149146 # https://github.com/JuliaLang/julia/pull/26733
147+ Base. similar (:: Type{T} , shape:: Tuple{UnitRange,Vararg{UnitRange}} ) where {T<: AbstractArray } =
148+ OffsetArray (T (undef, map (indexlength, shape)), map (indexoffset, shape))
150149 Base. similar (f:: Function , shape:: Tuple{UnitRange,Vararg{UnitRange}} ) =
151- OffsetArray (f (map (length , shape)), map (indexoffset, shape))
150+ OffsetArray (f (map (indexlength , shape)), map (indexoffset, shape))
152151else
152+ Base. similar (:: Type{T} , shape:: Tuple{OffsetAxis,Vararg{OffsetAxis}} ) where {T<: AbstractArray } =
153+ OffsetArray (T (undef, map (indexlength, shape)), map (indexoffset, shape))
154+
153155 Base. fill (v, inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
154156 fill! (OffsetArray (Array {typeof(v), N} (undef, map (indexlength, inds)), map (indexoffset, inds)), v)
155157 Base. zeros (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
0 commit comments