Bug or Feature: unsigned integer overflow

Tobias Pankrath tobias at pankrath.net
Sat Dec 14 07:09:30 UTC 2019


void main()
{
     auto x = 9223372036854775808; // long.max + 1
}

> onlineapp.d(3): Error: signed integer overflow

According to spec x should be of type ulong and this should 
compile? It indeed compiles if I add the uL postfix.

Is this a bug or indented behaviour?


More information about the Digitalmars-d-learn mailing list