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

MutableArithmetics/MathOptInterface ambiguity with v1.18.0 #2222

Closed
adrienbanse opened this issue Jun 23, 2023 · 4 comments · Fixed by #2224
Closed

MutableArithmetics/MathOptInterface ambiguity with v1.18.0 #2222

adrienbanse opened this issue Jun 23, 2023 · 4 comments · Fixed by #2224

Comments

@adrienbanse
Copy link

adrienbanse commented Jun 23, 2023

New release (v1.18.0) creates an ambiguity between + functions of MutableArithmetics and MathOptInterface.
See dionysos-dev/Dionysos.jl#256 for the whole error message.

cc @blegat

@blegat
Copy link
Member

blegat commented Jun 23, 2023

This seems to have been introduced in #2213

function Base.:+(
f::T,
g::Union{
MOI.VariableIndex,
MOI.ScalarAffineFunction{T},
MOI.ScalarQuadraticFunction{T},
},
) where {T}
return operate(+, T, f, g)
end

We could either specialize for MA.Zero or just write T<:Number.
I would write T<:Number since we already do that for *.

@odow
Copy link
Member

odow commented Jun 24, 2023

Do you have a reproducible example? How did the +(::MA.Zero, ::VariableRef) end up being called?

@adrienbanse
Copy link
Author

@odow odow closed this as completed in #2224 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants