Debian Codegraph @

tests/spec/unit/general/ambiguous_overload.mzn

raw
1 /***
2 !Test
3 solvers: [gecode]
4 expected: !Result
5 solution: !Solution
6 x: 1
7 y: false
8 ***/
9
10 % The compiler should really reject this unless the overload
11 % function bool: foo(int: i, bool: j)
12 % exists, but for now we should at least never incorrectly use the version
13 % that returns int when the original returned bool.
14
15 function int: foo(int: i, int: j) = 2;
16 function var bool: foo(var int: i, bool: j) = false;
17
18 var 1..1: x;
19 var bool: y :: output = foo(x, true);