https://issues.dlang.org/show_bug.cgi?id=13606
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |enhancement --- Comment #8 from Kenji Hara <[email protected]> --- (In reply to hsteoh from comment #7) > This looks like two bugs in one... the first appears to be caused by parsing > negative literals as the negation of the corresponding positive literal, and > the second is the implicit cast from unsigned to signed, which has been a > source of subtle bugs in D. Currently this is not a bug and the overflow error is expected behavior. As hsteoh said, the negative unary operator '-' is not a part of integer literal. -9223372036854775808L is parsed as a unary expression of negative operator '-' on the long literal 9223372036854775808L, and the overflowed signed literal which is typed as long by the suffix 'L' is rejected in lexer level. http://dlang.org/lex#integerliteral > 0L .. 9_223_372_036_854_775_807L long Long integer literal is limited up to 9_223_372_036_854_775_807. To allow the code, we need to update spec to support "negative integer literal". Change the importance to enhancement. --
