Initialization of an ulong with a decimal within range, but outside long range, gives a "Error: signed integer overflow" compiler error. Testcase: ``` enum a = 18446744073709551615; // 2^^64 - 1 ulong b = 18446744073709551615; // 2^^64 - 1 ```
That needs an "U" suffix, which is a little bit not obvious from the spec: https://dlang.org/spec/lex.html#integerliteral
Indeed, thanks. Specifically 2.12.8
I don't consider this resolved. Unsigned long values were accepted before without error, I cannot tell for sure when this changed. ulong x = 9223372036854775809; was considered valid code. I don't see the point in forcing the user to decorate his numbers with data type suffixes.
@benjones created dlang/dmd pull request #10607 "fix issue 19432 automatically interpret big int literals as " fixing this issue: - fix issue 19432 automatically interpret big int literals as unsigned longs if they dont fit in a signed long https://github.com/dlang/dmd/pull/10607
@benjones created dlang/dlang.org pull request #2718 "fix issue 19432 automatically interpret big int literals as " fixing this issue: - fix issue 19432 automatically interpret big int literals as unsigned longs if they dont fit in a signed long https://github.com/dlang/dlang.org/pull/2718
dlang/dlang.org pull request #2718 "fix issue 19432 automatically interpret big int literals as " was merged into master: - ca4a016638b47d755c1e7d196b8bafeb2f023803 by Ben Jones: fix issue 19432 automatically interpret big int literals as unsigned longs if they dont fit in a signed long https://github.com/dlang/dlang.org/pull/2718
dlang/dmd pull request #10607 "fix issue 19432 automatically interpret big int literals as " was merged into master: - b9443805651c40bb56250c195a3de70c9cdaa2f3 by Ben Jones: fix issue 19432 automatically interpret big int literals as unsigned longs if they dont fit in a signed long https://github.com/dlang/dmd/pull/10607