From 263b965ba2b5c6cec7b48aa4d760658707fba1c4 Mon Sep 17 00:00:00 2001 From: john verzani Date: Fri, 26 Apr 2024 15:55:06 -0400 Subject: [PATCH] close issue #566 (#567) * close issue #566 * remove bad test * typo --- Project.toml | 2 +- src/rational-functions/common.jl | 3 ++- test/rational-functions.jl | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 3d75fe9c..225a0b7c 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "Polynomials" uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" license = "MIT" author = "JuliaMath" -version = "4.0.7" +version = "4.0.8" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/rational-functions/common.jl b/src/rational-functions/common.jl index fb0fdd42..472de718 100644 --- a/src/rational-functions/common.jl +++ b/src/rational-functions/common.jl @@ -69,7 +69,8 @@ function Base.convert(::Type{PQ}, p::P) where {PQ <: AbstractRationalFunction, P T = isnothing(T′) ? eltype(p) : T′ X = indeterminate(PQ, p) - 𝐩 = convert(Polynomial{T,X}, p) + 𝑃 = Polynomials.:⟒(p) + 𝐩 = convert(𝑃{T,X}, p) rational_function(PQ, 𝐩, one(𝐩)) end diff --git a/test/rational-functions.jl b/test/rational-functions.jl index 7f10ea93..391af0e9 100644 --- a/test/rational-functions.jl +++ b/test/rational-functions.jl @@ -118,7 +118,10 @@ end ## T, Polynomial{T} promotes @test eltype([1, p, pp]) == PP - @test eltype(eltype(eltype([im, p, pp]))) == Complex{Int} + promote(im, p); promote(p, pp) # but promote(im, pp) fails + ## this is a bad test, a,b =promote(im,p) leave a P{Complex} + ## which doesn't convert to type pp. + # @test eltype(eltype(eltype([im, p, pp]))) == Complex{Int} ## test mixed types promote polynomial type @test eltype([pp rr p r]) == PP