diff --git a/src/dual.jl b/src/dual.jl index 91d2a93b..22129b68 100644 --- a/src/dual.jl +++ b/src/dual.jl @@ -305,11 +305,6 @@ Base.convert(::Type{Dual{T,V,N}}, d::Dual{T}) where {T,V<:Real,N} = Dual{T}(conv Base.convert(::Type{Dual{T,V,N}}, x::Real) where {T,V<:Real,N} = Dual{T}(V(x), zero(Partials{N,V})) Base.convert(::Type{D}, d::D) where {D<:Dual} = d -Base.promote_array_type(F, ::Type{D}, ::Type{A}) where {D<:Dual,A<:AbstractFloat} = promote_type(D, A) -Base.promote_array_type(F, ::Type{<:Dual}, ::Type{<:AbstractFloat}, ::Type{P}) where {P} = P -Base.promote_array_type(F, ::Type{A}, ::Type{D}) where {D<:Dual,A<:AbstractFloat} = promote_type(D, A) -Base.promote_array_type(F, ::Type{<:AbstractFloat}, ::Type{<:Dual}, ::Type{P}) where {P} = P - Base.float(d::Dual{T,V,N}) where {T,V,N} = Dual{T,promote_type(V, Float16),N}(d) Base.AbstractFloat(d::Dual{T,V,N}) where {T,V,N} = Dual{T,promote_type(V, Float16),N}(d) diff --git a/test/DualTest.jl b/test/DualTest.jl index b4737d24..d2686a1d 100644 --- a/test/DualTest.jl +++ b/test/DualTest.jl @@ -305,17 +305,6 @@ for N in (0,3), M in (0,4), V in (Int, Float32) @test convert(Dual{TestTag(),Dual{TestTag(),V,M},N}, FDNUM) === Dual{TestTag()}(Dual{TestTag(),V,M}(PRIMAL), convert(Partials{N,Dual{TestTag(),V,M}}, PARTIALS)) @test convert(Dual{TestTag(),Dual{TestTag(),WIDE_T,M},N}, FDNUM) === Dual{TestTag()}(Dual{TestTag(),WIDE_T,M}(PRIMAL), convert(Partials{N,Dual{TestTag(),WIDE_T,M}}, PARTIALS)) - if V != Int - @test Base.promote_array_type(+, Dual{TestTag(),V,N}, V, Base.promote_op(+, Dual{TestTag(),V,N}, V)) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, Dual{TestTag(),Int,N}, V, Base.promote_op(+, Dual{TestTag(),Int,N}, V)) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, V, Dual{TestTag(),V,N}, Base.promote_op(+, V, Dual{TestTag(),V,N})) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, V, Dual{TestTag(),Int,N}, Base.promote_op(+, V, Dual{TestTag(),Int,N})) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, Dual{TestTag(),V,N}, V) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, Dual{TestTag(),Int,N}, V) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, V, Dual{TestTag(),V,N}) == Dual{TestTag(),V,N} - @test Base.promote_array_type(+, V, Dual{TestTag(),Int,N}) == Dual{TestTag(),V,N} - end - ############## # Arithmetic # ##############