Skip to content

Commit

Permalink
Limit parameters in OrdinalRange{T1,T2}(::AbstractUnitRange)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Aug 26, 2021
1 parent 9f81f93 commit a9c52df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ AbstractUnitRange{T}(r::UnitRange) where {T} = UnitRange{T}(r)
AbstractUnitRange{T}(r::OneTo) where {T} = OneTo{T}(r)

OrdinalRange{T1, T2}(r::StepRange) where {T1, T2<: Integer} = StepRange{T1, T2}(r)
OrdinalRange{T, T}(r::AbstractUnitRange) where {T<:Integer} = AbstractUnitRange{T}(r)
OrdinalRange{T, T}(r::AbstractUnitRange) where {T} = AbstractUnitRange{T}(r)

function promote_rule(::Type{StepRange{T1a,T1b}}, ::Type{StepRange{T2a,T2b}}) where {T1a,T1b,T2a,T2b}
Tb = promote_type(T1b, T2b)
Expand Down

0 comments on commit a9c52df

Please sign in to comment.