Skip to content

Commit

Permalink
Merge pull request #38 from JuliaMath/teh/imageview_profileview
Browse files Browse the repository at this point in the history
Add missing constructor methods
  • Loading branch information
timholy authored Sep 4, 2018
2 parents a0983f1 + 8b0f528 commit 90576a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ function _union(A::TypedEndpointsInterval{L1,R1}, B::TypedEndpointsInterval{L2,R
Interval{L,R}(left, right)
end

ClosedInterval{T}(i::UnitRange{I}) where {T,I<:Integer} = ClosedInterval{T}(minimum(i), maximum(i))
ClosedInterval(i::UnitRange{I}) where {I<:Integer} = ClosedInterval{I}(minimum(i), maximum(i))
ClosedInterval{T}(i::AbstractUnitRange{I}) where {T,I<:Integer} = ClosedInterval{T}(minimum(i), maximum(i))
ClosedInterval(i::AbstractUnitRange{I}) where {I<:Integer} = ClosedInterval{I}(minimum(i), maximum(i))



Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ closedendpoints(I::MyUnitInterval) = (I.isleftclosed,I.isrightclosed)
@test @inferred(UnitRange{Int16}(I)) === Int16(0):Int16(3)
@test @inferred(ClosedInterval(0:3)) === I
@test @inferred(ClosedInterval{Float64}(0:3)) === 0.0..3.0
@test @inferred(ClosedInterval(Base.OneTo(3))) === 1..3
J = 3..2
K = 5..4
L = 3 ± 2
Expand Down

0 comments on commit 90576a7

Please sign in to comment.