Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed promote rule bug #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

kaandocal
Copy link

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.

@blegat
Copy link
Member

blegat commented Oct 12, 2021

Thanks, could you add a test ?

@kaandocal
Copy link
Author

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 :)

@blegat
Copy link
Member

blegat commented Oct 13, 2021

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.

@kaandocal
Copy link
Author

I managed to avoid the issue with some restructuring, but in the interest of closing this I added the proposed test

@kbarros
Copy link

kbarros commented Oct 1, 2022

I ran into a similar stack overflow error doing this:

using DynamicPolynomials
@polyvar x
@ncpolyvar y
x + y

Might be the same underlying problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants