Skip to content

Commit 2ccbee3

Browse files
fix: handle non-concrete polynomials in polynomial_merge!
1 parent 0e6fbb0 commit 2ccbee3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/operators.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ function polynomial_merge!(
9191
combine::F6,
9292
keep::F7,
9393
resize::F8,
94-
) where {F1,F2,F3,F4,F5,F6,F7,F8}
94+
::Type{coeff_type} = n1 > 0 ? typeof(get1(1)[1]) : n2 > 0 ? typeof(get2(1)[1]) : Nothing
95+
) where {F1,F2,F3,F4,F5,F6,F7,F8, coeff_type}
9596
buffer = nothing
9697
i = j = k = 1
9798
# Invariant:
@@ -109,7 +110,7 @@ function polynomial_merge!(
109110
if k == i
110111
t0 = get1(i)
111112
if buffer === nothing
112-
buffer = DataStructures.Queue{typeof(t0)}()
113+
buffer = DataStructures.Queue{Tuple{coeff_type, Vector{Int}}}()
113114
end
114115
push!(buffer, t0)
115116
i += 1

0 commit comments

Comments
 (0)