The following program raises a type-checking error:
def smalltest :=
#strata
program Core;
function bool_to_int (b: bool) : int {if b then 1 else 0}
function str_to_bool (s: string) : bool;
procedure test () returns ()
{
var b: string, i: int;
i := bool_to_int(str_to_bool(b));
};
#end
The error is
(0,(0-0)) ❌ Type checking error.
Impossible to unify string with bool.
But the when we rename the variable b in procedure test or function bool_to_int (only 1 of them, just to make the names different), then there is no error.