JuliaStochOpt / ParameterJuMP.jl

A JuMP extension to use parameter in constraints RHS
MIT License
41 stars 5 forks source link

anonymous parameter not allowed #84

Closed jd-lara closed 3 years ago

jd-lara commented 3 years ago

This syntax is no longer allowed


p = @variable(m, Param())
ERROR: LoadError: MethodError: no method matching parse_variable(::JuMP.var"#_error#86"{LineNumberNode,Tuple{Symbol,Expr}}, ::JuMP._VariableInfoExpr, ::Symbol)
Closest candidates are:
  parse_variable(::Function, ::JuMP._VariableInfoExpr, ::Symbol, ::Number, ::Any) at /Users/jdlara/.julia/packages/JuMP/qhoVb/src/macros.jl:1003
  parse_variable(::Function, ::JuMP._VariableInfoExpr, ::Symbol, ::Any, ::Any) at /Users/jdlara/.julia/packages/JuMP/qhoVb/src/macros.jl:994
  parse_variable(::Function, ::JuMP._VariableInfoExpr, ::Any, ::Symbol, ::Any, ::Symbol, ::Any) at /Users/jdlara/.julia/packages/JuMP/qhoVb/src/macros.jl:1026
Stacktrace:
 [1] @variable(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at /Users/jdlara/.julia/packages/JuMP/qhoVb/src/macros.jl:1245
in expression starting at REPL[12]:
jd-lara commented 3 years ago

my bad. This is allowed by

p = @variable(m, variable_type = Param())