@@ -851,6 +851,7 @@ function Base.:+(p::P, c::S) where {T,X, P<:AbstractPolynomial{T,X}, S}
851851 q + R (c)
852852end
853853
854+
854855# polynomial + polynomial when different types
855856function Base.:+ (p:: P , q:: Q ) where {T,X,P <: AbstractPolynomial{T,X} , S,Y,Q <: AbstractPolynomial{S,Y} }
856857 isconstant (p) && return constantterm (p) + q
@@ -944,6 +945,12 @@ function scalar_mult(c::S, p::P) where {S, T, X, P<:AbstractPolynomial{T, X}}
944945 𝐏 ([c * pᵢ for pᵢ ∈ coeffs (p)])
945946end
946947
948+ scalar_mult (c:: S , p:: Union{P, R} ) where {
949+ S<: AbstractPolynomial ,
950+ T, X,
951+ P<: AbstractPolynomial{T, X} ,
952+ R <: AbstractPolynomial{T}
953+ } = throw (DomainError ()) # avoid ambiguity, issue #435
947954
948955function Base.:/ (p:: P , c:: S ) where {P <: AbstractPolynomial ,S}
949956 _convert (p, coeffs (p) ./ c)
@@ -1082,6 +1089,11 @@ function Base.isapprox(p1::AbstractPolynomial{T},
10821089 return isapprox (p1, _convert (p1, [n]))
10831090end
10841091
1092+ Base. isapprox (:: AbstractPolynomial{T} , :: Missing , args... ; kwargs... ) where T =
1093+ missing
1094+ Base. isapprox (:: Missing , :: AbstractPolynomial{T} , args... ; kwargs... ) where T =
1095+ missing
1096+
10851097Base. isapprox (n:: S ,
10861098 p1:: AbstractPolynomial{T} ;
10871099 rtol:: Real = (Base. rtoldefault (T, S, 0 )),
0 commit comments