On Monday, 11 November 2013 at 07:52:34 UTC, luka8088 wrote:

Just for reference:
http://forum.dlang.org/thread/[email protected]

Again, this has nothing to do with runtime overflow checking. It's a compiler thing. It will be nice if the compiler will not accept implicit conversions from signed types to unsigned ones for negative values. An explicit cast can be used if someone wants to represent a negative number as unsigned.

Another consequence of this behaviour is the impossibility to select automatically an overload for signed and unsigned arguments:

void foo(ulong x) {}
void foo(long x) {}

foo(-3) //=> error, both match

Reply via email to