Skip to content

Commit dc49a75

Browse files
committed
fix depwarn for Julia 1.6
1 parent 72a705f commit dc49a75

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/IntervalSets.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ isopenset(d::AbstractInterval) = isleftopen(d) && isrightopen(d)
6363

6464
boundstype(i::AbstractInterval) = boundstype(typeof(i))
6565
boundstype(::Type{I}) where {I<:AbstractInterval{T}} where T = T
66-
@deprecate Base.eltype(I::Type{<:AbstractInterval}) boundstype(I) false
66+
67+
@static if VERSION < v"1.9"
68+
function Base.eltype(I::Type{<:AbstractInterval})
69+
Base.depwarn("`eltype` for `AbstractInterval` will be replaced with `boundstype` in the next breaking release (v0.8.0).", :eltype)
70+
boundstype(I)
71+
end
72+
else
73+
@deprecate Base.eltype(I::Type{<:AbstractInterval}) boundstype(I) false
74+
end
6775

6876
convert(::Type{AbstractInterval}, i::AbstractInterval) = i
6977
convert(::Type{AbstractInterval{T}}, i::AbstractInterval{T}) where T = i

0 commit comments

Comments
 (0)