jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.22k stars 393 forks source link

Fix broadcasting f-in-set in constraint macro #3632

Closed odow closed 9 months ago

odow commented 9 months ago

x-ref #3629

So this line was never covered: https://app.codecov.io/gh/jump-dev/JuMP.jl/commit/419c3344c9a62692e344da745765ac7daec95c01/blob/src/macros.jl#L839

The Ref was added here: https://github.com/jump-dev/JuMP.jl/pull/1438/files#diff-e628f2d30670b1af0cdd9c9c520aaddc44021cd503e169d767ec49c95f189264R288

I guess because we didn't yet have: https://github.com/jump-dev/MathOptInterface.jl/commit/ed08ee98f5d7ad65bbd1f5414f5b448e0d2dc78c

I think it's because only the .∈ syntax supports this. You can't . the in-fix in operator:

julia> dump(:(x .in y))
ERROR: syntax: space before "." not allowed in "x ." at REPL[76]:1
Stacktrace:
 [1] top-level scope
   @ none:1

julia> dump(:(x in. y))
ERROR: syntax: invalid identifier name "."
Stacktrace:
 [1] top-level scope
   @ none:1
codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2896184) 98.22% compared to head (d6fc941) 98.24%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3632 +/- ## ========================================== + Coverage 98.22% 98.24% +0.01% ========================================== Files 43 43 Lines 5636 5636 ========================================== + Hits 5536 5537 +1 + Misses 100 99 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.