Skip to content

Commit

Permalink
Fix range implementation for promotion changes in 0.7-dev.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkeller34 committed Dec 14, 2017
1 parent 25cba6c commit b4b3a7a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ range(a::Quantity{<:Real}, st::Quantity{<:AbstractFloat}, len::Integer) =
range(float(a), st, len)
range(a::Quantity{<:AbstractFloat}, st::Quantity{<:Real}, len::Integer) =
range(a, float(st), len)
range(a::Quantity{<:AbstractFloat}, st::Quantity{<:AbstractFloat}, len::Integer) =
_range(promote(a, st)..., len)
_range(a::T, st::T, len) where {T<:Quantity} = range(a, st, len)
_range(a, st, len) = throw(DimensionError(a, st))

function range(a::Quantity{<:AbstractFloat}, st::Quantity{<:AbstractFloat}, len::Integer)
dimension(a) != dimension(st) && throw(DimensionError(a, st))
range(promote(a, st)..., len)
end
range(a::Quantity, st::Real, len::Integer) = range(promote(a, st)..., len)
range(a::Real, st::Quantity, len::Integer) = range(promote(a, st)..., len)

Expand Down

0 comments on commit b4b3a7a

Please sign in to comment.