Expression #= none:3 =# should not be used as a variable name

If I write

using JuMP
@variable(pro,begin
    t1>=1 
    t2>=2 
    t3>=3
end)

I find a error like this

ERROR: LoadError: Expression #= none:3 =# should not be used as a variable name. Use the "anonymous" syntax #= none:3 =# = @variable(model, ...) instead.

I want to know if there are errors for expression or just the version problem of julia and JuMP?

Looks like you probably want the @variables (note the s) macro instead?

https://jump.dev/JuMP.jl/stable/manual/variables/#variables

2 Likes

We should probably throw a better error in this case. I’ve opened an issue: Improve error when singular macro used instead of plural · Issue #2582 · jump-dev/JuMP.jl · GitHub

Thank you very much for you help. It should be “variables”.

1 Like

OK :ok_hand:

1 Like