diff --git a/ext/IntervalArithmeticForwardDiffExt.jl b/ext/IntervalArithmeticForwardDiffExt.jl index 869d926e..520ff828 100644 --- a/ext/IntervalArithmeticForwardDiffExt.jl +++ b/ext/IntervalArithmeticForwardDiffExt.jl @@ -5,13 +5,16 @@ using ForwardDiff: Dual, ≺, value, partials # Needed to avoid method ambiguities: Base.promote_rule(::Type{Dual{T, V, N}}, ::Type{Interval{S}}) where {T, V, N, S<:Union{AbstractFloat, Rational}} = - Interval{IntervalArithmetic.promote_numtype(V, S)} + Dual{T,Interval{IntervalArithmetic.promote_numtype(V, S)},N} + +Base.promote_rule(::Type{Interval{S}}, ::Type{ForwardDiff.Dual{T, V, N}}) where {S<:Union{AbstractFloat, Rational}, T, V, N} = + Dual{T,Interval{IntervalArithmetic.promote_numtype(V, S)},N} Base.promote_rule(::Type{ExactReal{S}}, ::Type{Dual{T, V, N}}) where {S<:Real, T, V, N} = - ExactReal{IntervalArithmetic.promote_numtype(V, S)} + Dual{T,ExactReal{IntervalArithmetic.promote_numtype(V, S)},N} Base.promote_rule(::Type{Dual{T, V, N}}, ::Type{ExactReal{S}}) where {S<:Real, T, V, N} = - ExactReal{IntervalArithmetic.promote_numtype(V, S)} + Dual{T,ExactReal{IntervalArithmetic.promote_numtype(V, S)},N} Base.:(==)(x::Union{BareInterval,Interval}, y::Dual) = isthin(x, y) Base.:(==)(x::Dual, y::Union{BareInterval,Interval}) = y == x