On 12/30/15 9:07 AM, Daniel Kozak wrote:
import std.stdio;

void main() {

     auto x = 9223372036854775807L;
     auto x2 = 9223372036854775807L + 1;
     long x3 = -9223372036854775808U;
     //auto x4 = -9223372036854775808L; //Error: signed integer overflow

Not a bug.

This is parsed as - (9223372036854775808L)

That number cannot be represented in signed long, so it fails.

The only correct thing to do is via x3.

-Steve

Reply via email to