libminizinc
libminizinc copied to clipboard
Internal error: missing builtin 'enum2int'
2.9.0 has a regression due to the new enum coercion checks not correctly removing calls to enum2int when they are used as the value of (or index of) comprehensions, leading to the following error:
MiniZinc: evaluation error: internal error: missing builtin 'enum2int'
This will be fixed in the next release.
As a workaround for now, the following definitions can be added to the model:
function int: enum2int($$E: x) = x;
function var int: enum2int(var $$E: x) = x;
function opt int: enum2int(opt $$E: x) = x;
function var opt int: enum2int(var opt $$E: x) = x;
function opt set of int: enum2int(opt set of $$E: x) = x;
function set of int: enum2int(set of $$E: x) = x;
function var set of int: enum2int(var set of $$E: x) = x;