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

Hygiene issue with indicator constraints #3812

Closed
blegat opened this issue Aug 29, 2024 · 2 comments · Fixed by #3813
Closed

Hygiene issue with indicator constraints #3812

blegat opened this issue Aug 29, 2024 · 2 comments · Fixed by #3813

Comments

@blegat
Copy link
Member

blegat commented Aug 29, 2024

model = Model()
@variable(model, b, Bin)
@variable(model, x)
@constraint(model, b => {x in MOI.EqualTo(1.0)})

gives

ERROR: LoadError: UndefVarError: `##3910` not defined
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/JuMP/W1IDA/src/macros/@constraint.jl:171 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/JuMP/W1IDA/src/macros.jl:393 [inlined]

The hygiene seems ok if you do x == 1 but not with the in syntax

@odow
Copy link
Member

odow commented Aug 29, 2024

Hmm. Yeah. I don't think we considered this, but we should throw a nicer error message.

@odow
Copy link
Member

odow commented Aug 29, 2024

Simple fix: #3813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants