Lexer doesn't recognize Int64 minimal value
- Dominant language
- OCaml
- Stars
- 45
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Writing `Int64` minimal value `-9223372036854775808L` gets you an out of bounds error as the absolute value exceeds the max value of `Int64`.
```sh
> let a = -9223372036854775808L ;;
fatal error: Integer literal 9223372036854775808 exceeds the representable range
| let a = -9223372036854775808L ;;
| ^^^^^^^^^^^^^^^^^^^
|
> let a = -9223372036854775807L - 1L ;;
> a ;;
: Int64
= -9223372036854775808L
>
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported REPL input `let a = -9223372036854775808L ;;` and inspect the lexer’s integer-literal handling. Compare it with the working `-9223372036854775807L - 1L` form; done means the minimal Int64 literal is accepted and evaluates to `-9223372036854775808L` without the out-of-bounds error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100