nemerle
nemerle copied to clipboard
-0x8000000000000000l is too large for given type
Trying to compile
System.Console.WriteLine(-0x8000000000000000l);
yields
foo.n:1:46:1:46: error: number literal 08000000000000000 is too large for given type
which is wrong, since -0x8000000000000000l == Int64.MinValue
, and doing someting like this in C# also works. It looks like the compiler is trying to convert the input number from ulong
to long
, then negate it, which fails since 0x8000000000000000l
is indeed invalid.
The same problem appears with -0x80sb
, -0x8000s
. Doing -0x80000000
works correctly.
As you can see in Lexer.n: https://github.com/rsdn/nemerle/blob/master/ncc/parsing/Lexer.n#L1261 You are totally correct. You can help us fixing this code to parse correctly using Int64 and not UInt64 in that case. Don't forget to write test :)