Skip to content

Commit 2af043b

Browse files
committed
Small fix
1 parent 487945b commit 2af043b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/poly.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function polynomialclean(vars::Vector{PolyVar{C}}, adup::Vector{T}, Zdup::Vector
151151
Polynomial{C, T}(a, MonomialVector{C}(vars, Z))
152152
end
153153

154-
MP.polynomial(a::AbstractVector, x::DMonoVec, s::MP.ListState) = Polynomial(a, x)
154+
MP.polynomial(a::AbstractVector, x::DMonoVec, s::MP.ListState) = Polynomial(collect(a), x)
155155

156156
#MP.polynomial(f::Function, x::AbstractVector) = Polynomial(f, x)
157157
#MP.polynomial(ts::AbstractVector{Term{C, T}}) where {C, T} = Polynomial(coefficient.(ts), monomial.(ts)) # FIXME invalid age range update

test/poly.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
@test typeof(constantterm(1, x)) == Term{true, Int}
2121
@inferred constantterm(1, x)
22+
@test typeof(polynomial(1:2, monomials([x], 1:2))) == Polynomial{true, Int}
2223
end
2324

2425
@testset "Polynomial" begin

0 commit comments

Comments
 (0)