From c83da89375ddf36a1534e631aea2aae811eb0f38 Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Tue, 8 Mar 2022 23:50:31 +0100 Subject: [PATCH] fix ambiguity for `promote_rule` (#298) --- Project.toml | 2 +- src/conversion.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index cb69855a..7807bdca 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TaylorSeries" uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea" repo = "https://github.com/JuliaDiff/TaylorSeries.jl.git" -version = "0.12.0" +version = "0.12.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/conversion.jl b/src/conversion.jl index 7e038f21..6342f7c7 100644 --- a/src/conversion.jl +++ b/src/conversion.jl @@ -187,8 +187,6 @@ promote_rule(::Type{HomogeneousPolynomial{T}}, ::Type{S}) where promote_rule(::Type{TaylorN{T}}, ::Type{TaylorN{S}}) where {T<:Number,S<:Number} = TaylorN{promote_type(T,S)} -promote_rule(::Type{TaylorN{T}}, ::Type{TaylorN{T}}) where {T<:Number} = TaylorN{T} - promote_rule(::Type{TaylorN{T}}, ::Type{HomogeneousPolynomial{S}}) where {T<:Number,S<:Number} = TaylorN{promote_type(T,S)} @@ -202,6 +200,8 @@ promote_rule(::Type{TaylorN{T}}, ::Type{S}) where {T<:Number,S<:Number} = # Order may matter promote_rule(::Type{S}, ::Type{T}) where {S<:NumberNotSeries,T<:AbstractSeries} = promote_rule(T,S) +# disambiguation with Base +promote_rule(::Type{Bool}, ::Type{T}) where {T<:AbstractSeries} = promote_rule(T, Bool) promote_rule(::Type{S}, ::Type{T}) where {S<:AbstractIrrational,T<:AbstractSeries} = promote_rule(T,S)