Skip to content

Commit

Permalink
Remove similar specialization with Integers (#56881)
Browse files Browse the repository at this point in the history
This method seems unnecessary, as the method on line 830 does the same
thing. Having this method in `Base` requires packages to disambiguate
against this by adding redundant methods.
  • Loading branch information
jishnub authored Dec 23, 2024
1 parent ccfeb93 commit dde5028
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ similar(a::AbstractArray, ::Type{T}, dims::DimOrInd...) where {T} = similar(a,
# define this method to convert supported axes to Ints, with the expectation that an offset array
# package will define a method with dims::Tuple{Union{Integer, UnitRange}, Vararg{Union{Integer, UnitRange}}}
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Union{Integer, OneTo}, Vararg{Union{Integer, OneTo}}}) where {T} = similar(a, T, to_shape(dims))
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}) where {T} = similar(a, T, to_shape(dims))
# similar creates an Array by default
similar(a::AbstractArray, ::Type{T}, dims::Dims{N}) where {T,N} = Array{T,N}(undef, dims)

Expand Down

0 comments on commit dde5028

Please sign in to comment.