Skip to content

Commit

Permalink
fix invalidations; close issue #403 (#406)
Browse files Browse the repository at this point in the history
* fix invalidations; close issue #403

* better fix, but not as general
  • Loading branch information
jverzani authored May 26, 2022
1 parent ddb9e57 commit 8b1c45a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Polynomials"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
license = "MIT"
author = "JuliaMath"
version = "3.1.0"
version = "3.1.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
10 changes: 3 additions & 7 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,9 @@ LinearAlgebra.transpose!(p::AbstractPolynomial) = p
Conversions =#
Base.convert(::Type{P}, p::P) where {P <: AbstractPolynomial} = p
Base.convert(P::Type{<:AbstractPolynomial}, x) = P(x)
function Base.convert(::Type{S}, p::P) where {S <: Number,T, P<:AbstractPolynomial{T}}
isconstant(p) && return convert(S, constantterm(p))
throw(ArgumentError("Can't convert a nonconstant polynomial to type $S"))
end
function Base.convert(::Type{T}, p::P) where {T, P<:AbstractPolynomial{T}}
isconstant(p) && return constantterm(p)
throw(ArgumentError("Can't convert a nonconstant polynomial to type $S"))
function Base.convert(::Type{T}, p::AbstractPolynomial{T,X}) where {T <: Number,X}
isconstant(p) && return T(constantterm(p))
throw(ArgumentError("Can't convert a nonconstant polynomial to type $T"))
end

# Methods to ensure that matrices of polynomials behave as desired
Expand Down

2 comments on commit 8b1c45a

@jverzani
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/61126

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.1.1 -m "<description of version>" 8b1c45a3403013095f88f0b7ac68f54afea8bf5c
git push origin v3.1.1

Please sign in to comment.