@@ -119,9 +119,6 @@ function Base.similar(A::AbstractArray, ::Type{T}, inds::Tuple{OffsetAxis,Vararg
119
119
OffsetArray (B, map (indexoffset, inds))
120
120
end
121
121
122
- Base. similar (:: Type{T} , shape:: Tuple{OffsetAxis,Vararg{OffsetAxis}} ) where {T<: AbstractArray } =
123
- OffsetArray (T (undef, map (indexlength, shape)), map (indexoffset, shape))
124
-
125
122
if VERSION < v " 0.7.0-DEV.5242"
126
123
# Reshape's methods in Base changed, so using the new definitions leads to ambiguities
127
124
Base. reshape (A:: AbstractArray , inds:: Tuple{UnitRange,Vararg{UnitRange}} ) =
147
144
if VERSION < v " 0.7.0-DEV.4873"
148
145
# Julia PR #26733 removed similar(f, ...) in favor of just using method extension directly
149
146
# 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))
150
149
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))
152
151
else
152
+ Base. similar (:: Type{T} , shape:: Tuple{OffsetAxis,Vararg{OffsetAxis}} ) where {T<: AbstractArray } =
153
+ OffsetArray (T (undef, map (indexlength, shape)), map (indexoffset, shape))
154
+
153
155
Base. fill (v, inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {N} =
154
156
fill! (OffsetArray (Array {typeof(v), N} (undef, map (indexlength, inds)), map (indexoffset, inds)), v)
155
157
Base. zeros (:: Type{T} , inds:: NTuple{N, Union{Integer, AbstractUnitRange}} ) where {T, N} =
0 commit comments