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
I'm trying to make sure the recently added opt float vars are correctly implemented, but found this regarding the integer opt vars on the way, so I'm opening this separate issue:
var 1..2: x;
var bool: y;
var 1..2: f;
constraint f = if y then x else <> endif;
throws a compiler error
in binary '=' operator expression
in if-then-else expression
/home/marco/tmp/libminizinc/share/minizinc/std//builtins.mzn:891:
in call 'fzn_if_then_else_var_opt_int'
/home/marco/tmp/libminizinc/share/minizinc/std//fzn_if_then_else_var_opt_int.mzn:5:
in binary '/\' operator expression
in call 'fzn_if_then_else_var_int'
in array comprehension expression
with i = 2
in call 'deopt'
ambiguous overloading on return type of function
I can't understand the problem since overloading resolution is top-down, fixing <> to "var int".
Activity
marcovc commentedon Oct 17, 2019
Oh actually I understand the problem now. Seems hard to solve. Can we have a deopt_int ? :)
marcovc commentedon Oct 17, 2019
This is a smaller example (it's what fzn_if_then_else_var_opt_int.mzn is trying to do):
gives:
Help type checker by making deopt/occurs argument types explicit. Fixes