You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* deprecated message for 1..missing
* add TODO comment for the next breaking release
* Update depwarn message
Co-authored-by: Tim Holy <[email protected]>
Co-authored-by: Tim Holy <[email protected]>
Copy file name to clipboardExpand all lines: src/interval.jl
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,14 @@ mathematical notation, the constructed range is `(left, right)`.
27
27
const OpenInterval{T} = Interval{:open,:open,T}
28
28
29
29
Interval{L,R,T}(i::AbstractInterval) where {L,R,T} =Interval{L,R,T}(endpoints(i)...)
30
-
Interval{L,R}(left, right) where {L,R} =Interval{L,R,promote_type(typeof(left), typeof(right))}(left,right)
30
+
functionInterval{L,R}(left, right) where {L,R}
31
+
#TODO: Replace the retrun value with `Interval{L,R}(promote(left,right)...)`. (#93)
32
+
T =promote_type(typeof(left), typeof(right))
33
+
if!isconcretetype(T)
34
+
Base.depwarn("`Promotion to a concrete type failed and will error in the next release; consider constructing this interval as `Interval{L,R,$(typejoin(typeof(left),typeof(right)))}(left, right)`.", :Interval)
35
+
end
36
+
Interval{L,R,T}(left,right)
37
+
end
31
38
Interval{L,R}(left::T, right::T) where {L,R,T} =Interval{L,R,T}(left, right)
0 commit comments