Skip to content

Commit e6a0138

Browse files
authored
Merge pull request #13 from alsam/teh/better_deprecations
Avoid throwing depwarn for zeros/ones methods defined in Base
2 parents faa8621 + f142a91 commit e6a0138

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/OffsetArrays.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ end
172172

173173
# Deprecations
174174
import Base: zeros, ones
175-
@deprecate zeros(T::Type, inds::UnitRange...) fill!(OffsetArray{T}(inds), zero(T))
176-
@deprecate ones(T::Type, inds::UnitRange...) fill!(OffsetArray{T}(inds), one(T))
177-
@deprecate zeros(inds::UnitRange...) fill!(OffsetArray{Float64}(inds), 0)
178-
@deprecate ones(inds::UnitRange...) fill!(OffsetArray{Float64}(inds), 1)
175+
@deprecate zeros(T::Type, ind1::UnitRange, ind2::UnitRange, inds::UnitRange...) fill!(OffsetArray{T}((ind1, ind2, inds...)), zero(T))
176+
@deprecate ones(T::Type, ind1::UnitRange, inds2::UnitRange, inds::UnitRange...) fill!(OffsetArray{T}((ind1, ind2, inds...)), one(T))
177+
@deprecate zeros(ind1::UnitRange, ind2::UnitRange, inds::UnitRange...) fill!(OffsetArray{Float64}((ind1, ind2, inds...)), 0)
178+
@deprecate ones(ind1::UnitRange, ind2::UnitRange, inds::UnitRange...) fill!(OffsetArray{Float64}((ind1, ind2, inds...)), 1)
179179

180180
end # module

0 commit comments

Comments
 (0)