libminizinc
libminizinc copied to clipboard
Partial assignment of enum var results in type error
enum E = {A,B};
array[1..2] of var E: X = [
if i == 1 then B else _ endif
| i in 1..2
];
result
MiniZinc:
type error: initialisation value for `X' has invalid type-inst: expected `array[_] of var E', actual `array[int] of var int'
Process finished with non-zero exit code 1.
Seen in 2.8.5 and edge
enum E = {A,B};
array[1..2] of var E: X;
constraint X == [
if i == 1 then B else _ endif
| i in 1..2
];
Very nice. Also looks like it works for array2d and I'm guessing the other multi-dimensional array creating functions
♥