Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Apr 24, 2024
1 parent a2bedfd commit e03e3f8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,5 +572,18 @@ end
# These methods are used to provide an efficient implementation for a common
# case like `x^2 * sum(f for i in 1:0)`, which lowers to
# `_MA.operate!!(*, x^2, _MA.Zero())`
_MA.operate!!(::typeof(*), ::AbstractJuMPScalar, ::_MA.Zero) = _MA.Zero()
_MA.operate!!(::typeof(*), ::_MA.Zero, ::AbstractJuMPScalar) = _MA.Zero()
function _MA.promote_operation(
::typeof(*),
::Type{<:AbstractJuMPScalar},
::Type{_MA.Zero},
)
return _MA.Zero
end

function _MA.promote_operation(

Check warning on line 583 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L583

Added line #L583 was not covered by tests
::typeof(*),
::Type{_MA.Zero},
::Type{<:AbstractJuMPScalar},
)
return _MA.Zero

Check warning on line 588 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L588

Added line #L588 was not covered by tests
end

0 comments on commit e03e3f8

Please sign in to comment.