MutableArithmetics.jl
MutableArithmetics.jl copied to clipboard
Simplify promote_type_fallback
Suggested by @AayushSabharwal. I am wondering whether that wouldn't be better compared to what we have.
The types for which that does not work are the types from JuMP, MOI and MultivariatePolynomials for which we already have custom methods (because the fallback would be allocating).
This also won't work for Matrix * Vector but the fallback with one also don't work there.
It also fixes the following but that @AayushSabharwal just reported to me:
julia> MA.promote_operation(+, Number, Number)
Int64
It would also reduce the number of weird errors reported by users of JuMP saying zero(::...) is not defined.