Thanks to @pulsipher for some insight here: It’s probably a run time issue with the macros. When I replace the @NLconstraints macro with add_nonlinear_constraint, the examples now work:
function add_con(m, con_quote)
quote
try
@constraints($m,$con_quote)
catch
for cq in $con_quote
add_nonlinear_constraint($m,cq)
end
end
end
end