Skip to content

Commit efeb466

Browse files
authored
promote tuples as arguments before collection (#453)
* promote tuples as arguments before collection * version bump
1 parent feae79d commit efeb466

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "Polynomials"
22
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
33
license = "MIT"
44
author = "JuliaMath"
5-
version = "3.2.2"
5+
version = "3.2.3"
66

77
[deps]
88
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/abstract.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ macro register(name)
102102
end
103103
function $poly(coeffs::G, var::SymbolLike=Var(:x)) where {G}
104104
!Base.isiterable(G) && throw(ArgumentError("coeffs is not iterable"))
105-
cs = collect(coeffs)
105+
cs = collect(promote(coeffs...))
106106
$poly{eltype(cs), Symbol(var)}(cs)
107107
end
108108

test/StandardBasis.jl

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ isimmutable(::Type{<:ImmutablePolynomial}) = true
5959
## issue #395
6060
v = [1,2,3]
6161
@test P(v) == P(v,:x) == P(v,'x') == P(v,"x") == P(v, Polynomials.Var(:x))
62+
63+
## issue #452
64+
ps = (1, 1.0)
65+
P != FactoredPolynomial && @test eltype(P(ps)) == eltype(promote(ps...))
6266
end
6367
end
6468
end

0 commit comments

Comments
 (0)