JuliaIntervals / IntervalConstraintProgramming.jl

Calculate rigorously the feasible region for a set of real-valued inequalities with Julia
Other
63 stars 16 forks source link

constants interpolation not working on julia 1.6 upwards #180

Open lucaferranti opened 3 years ago

lucaferranti commented 3 years ago

Constant interpolation does not seem to work anymore when defining constraints.

In julia 1.5

julia> a = 3
3

julia> S = @constraint x^2 + y^2 - $a <= 0
Separator:
  - variables: x, y
  - expression: (x ^ 2 + y ^ 2) - 3 ∈ [-∞, 0]

whereas in julia 1.6

   julia> a = 3
3

julia> S = @constraint x^2 + y^2 - $a < 0
ERROR: UndefVarError: a not defined
Stacktrace:
 [1] top-level scope
   @ ~\.julia\packages\IntervalConstraintProgramming\ThYlN\src\separator.jl:153
lucaferranti commented 3 years ago

I wonder whether this change in 1.6 is the reason of the issue (from here )

Macros that return :quote expressions (e.g. via Expr(:quote, ...)) were previously able to work without escaping (esc(...)) their output when needed. This has been corrected, and now esc must be used in these macros as it is in other macros.