MultivariatePolynomials.jl
MultivariatePolynomials.jl copied to clipboard
Fixed promote rule bug
Related to this issue. The generic promote_rule in question is provided symmetrically (as far as I'm aware promote_type takes care of that), but the specialisation to T=Any is only provided in one direction. This fixes the problem I was having.
Thanks, could you add a test ?
I'm not sure what test to add for this - the Julia docs state that promote_rule does not need to be specified symmetrically, this commit just removed one redundant definition :)
Adding
promote_type(Any, typeof(MP.changecoefficienttype(x + 1, Any)))
in https://github.com/JuliaAlgebra/MultivariatePolynomials.jl/blob/master/test/promote.jl should cover it.
I managed to avoid the issue with some restructuring, but in the interest of closing this I added the proposed test
I ran into a similar stack overflow error doing this:
using DynamicPolynomials
@polyvar x
@ncpolyvar y
x + y
Might be the same underlying problem.