-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Diagnostic for named constraint without constraint could be improved #3780
Comments
Replace |
Unsupported constraint expression: we don't know how to parse constraints containing expressions of type :vect.
D'oh! Thank you. |
MWE: julia> using JuMP
julia> model = Model();
julia> @variable(model, x)
x
julia> @constraint(model, c, [k in 1:2], x <= k)
ERROR: LoadError: At REPL[9]:1: `@constraint(model, c, [k in 1:2], x <= k)`: Unsupported constraint expression: we don't know how to parse constraints containing expressions of type :vect.
If you are writing a JuMP extension, implement `parse_constraint_head(::Function, ::Val{:vect}, args...)
Stacktrace:
[1] error(::String, ::String)
@ Base ./error.jl:44
[2] (::JuMP.Containers.var"#error_fn#98"{String})(str::String)
@ JuMP.Containers ~/.julia/dev/JuMP/src/Containers/macro.jl:331
[3] parse_constraint_head(error_fn::JuMP.Containers.var"#error_fn#98"{String}, ::Val{:vect}, args::Expr)
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:412
[4] parse_constraint(error_fn::Function, expr::Expr)
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:307
[5] var"@constraint"(__source__::LineNumberNode, __module__::Module, input_args::Vararg{Any})
@ JuMP ~/.julia/dev/JuMP/src/macros/@constraint.jl:140
in expression starting at REPL[9]:1 We can improve this particular error message. @LebedevRI since you've now opened quite a few issues, I might ask that you try to make minimal reproducible examples: strip out all the unnecessary stuff, like HiGHS, the Symmetric, comments, etc, so that only the code necessary to reproduce the bug remains. |
Thank you for taking a look!
FWIW, i'm already doing that, but i guess insufficiently. |
The text was updated successfully, but these errors were encountered: