You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4689 Reporter: llb Status: resolved (set by @xavierleroy on 2012-08-02T17:25:40Z) Resolution: suspended Priority: normal Severity: minor Version: 3.11.0+beta Category: ~DO NOT USE (was: OCaml general) Monitored by:@glondu
Bug description
max_int;;
: int = 1073741823
1073741824;;
: int = -1073741824
1073741825;;
Characters 0-10:
1073741825;;
^^^^^^^^^^
Error: Integer literal exceeds the range of representable integers of type int
The integer literal 1073741824 should rise an error, since it's greater than max_int. It currently returns an erroneous value.
The text was updated successfully, but these errors were encountered:
1- Because "f-1" should not be parsed as "f(-1)", "-1073741824" is, lexically, the unary minus operator applied to "1073741824". So, we need to be able to represent "1073741824" (the opposite of min_int) in lexer tokens.
2- Still assuming a 32-bit platform, we really want to be able to write
"x land 0x4000_0000" (or similar bit-masking operations) and not be forced to write "x land (-0x4000_0000)".
The problem reported could possibly be solved by keeping integer literals as strings during lexing and parsing, pushing their resolution into integers deeper in the compiler. But that's a lot of changes for a minor benefit. I'm suspending this PR until someone comes up with a better idea.
Original bug ID: 4689
Reporter: llb
Status: resolved (set by @xavierleroy on 2012-08-02T17:25:40Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 3.11.0+beta
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @glondu
Bug description
max_int;;
1073741824;;
1073741825;;
Characters 0-10:
1073741825;;
^^^^^^^^^^
Error: Integer literal exceeds the range of representable integers of type int
The integer literal 1073741824 should rise an error, since it's greater than max_int. It currently returns an erroneous value.
The text was updated successfully, but these errors were encountered: