Skip to content

Commit

Permalink
promote tuples as arguments before collection (#453)
Browse files Browse the repository at this point in the history
* promote tuples as arguments before collection

* version bump
  • Loading branch information
jverzani authored Jan 19, 2023
1 parent feae79d commit efeb466
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 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.2.2"
version = "3.2.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion src/abstract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ macro register(name)
end
function $poly(coeffs::G, var::SymbolLike=Var(:x)) where {G}
!Base.isiterable(G) && throw(ArgumentError("coeffs is not iterable"))
cs = collect(coeffs)
cs = collect(promote(coeffs...))
$poly{eltype(cs), Symbol(var)}(cs)
end

Expand Down
4 changes: 4 additions & 0 deletions test/StandardBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ isimmutable(::Type{<:ImmutablePolynomial}) = true
## issue #395
v = [1,2,3]
@test P(v) == P(v,:x) == P(v,'x') == P(v,"x") == P(v, Polynomials.Var(:x))

## issue #452
ps = (1, 1.0)
P != FactoredPolynomial && @test eltype(P(ps)) == eltype(promote(ps...))
end
end
end
Expand Down

2 comments on commit efeb466

@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/75992

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.2.3 -m "<description of version>" efeb4663b716a13bdcd21e829b4d2854fc5e385d
git push origin v3.2.3

Please sign in to comment.