You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interpolation evaluates a = x, returns the RHS x, substitutes it in, and away we go. So we can't intercept it at a functional level.
I guess you could walk the expression of the constraint and see if there are any :(=), then throw an error, but it would get tricky to work around generators etc.
I bet there is also at least one person relying on this with some weird expression, so erroring on this would break code.
julia> model =Model();
julia>@variable(model, x);
julia>@constraint(model, (a =2; a^2) * x <=1)
4 x ≤1.0
I vote we close this, because there's nothing technically wrong (and people may be relying on it), and it has only come up once on Discourse. We can revisit if there are more reports.
Simplified from https://discourse.julialang.org/t/how-to-print-the-values-of-constraints/40040:
I'm not sure how exactly, but this should produce an error.
The text was updated successfully, but these errors were encountered: