From 5ce3e7b2f7602111614275e0ca27e051257f2616 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 15 Apr 2024 14:00:57 +1200 Subject: [PATCH] Add missing promote_operation method (#3730) --- src/mutable_arithmetics.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mutable_arithmetics.jl b/src/mutable_arithmetics.jl index c3c47363332..cbfb48a27be 100644 --- a/src/mutable_arithmetics.jl +++ b/src/mutable_arithmetics.jl @@ -133,6 +133,14 @@ function _MA.promote_operation( return GenericQuadExpr{T,V} end +function _MA.promote_operation( + ::typeof(*), + ::Type{GenericAffExpr{T,V}}, + ::Type{GenericAffExpr{S,V}}, +) where {T,S,V<:AbstractVariableRef} + return GenericQuadExpr{_MA.promote_operation(*, T, S),V} +end + function _MA.isequal_canonical(x::T, y::T) where {T<:AbstractJuMPScalar} return isequal_canonical(x, y) end