20543, "mppf", "should int to uint implicit conversion add a runtime check?", "2022-08-29T18:27:27Z"
This issue is about adding runtime checking for certain implicit conversions from int to uint. Issue #20091 discusses adding such implicit conversions and PR #20528 adds them.
After PR #20528, we can write code that changes a negative int
to to a uint
implicitly. For example:
proc f(arg: uint) { writeln("in f, arg=", arg); }
f(-1);
produces this output:
in f, arg=18446744073709551615
Should we seek to add some checking that can be enabled with --checks
that would halt if a negative number is implicitly converted in this way?