Skip to content

Commit ad70379

Browse files
committed
Promote bound of Interval if they have different types
1 parent 278fba5 commit ad70379

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sets.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ struct Interval{T<:Real} <: AbstractScalarSet
286286
upper::T
287287
end
288288

289+
function Interval(lower, upper)
290+
return Interval(promote(lower, upper)...)
291+
end
292+
289293
function Base.:(==)(a::Interval{T}, b::Interval{T}) where {T}
290294
return a.lower == b.lower && a.upper == b.upper
291295
end

0 commit comments

Comments
 (0)