Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversions from Int64 to Int don't check bounds correctly #167

Open
forell opened this issue Dec 13, 2024 · 0 comments
Open

Conversions from Int64 to Int don't check bounds correctly #167

forell opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working stdlib Work on standard library

Comments

@forell
Copy link
Member

forell commented Dec 13, 2024

There are actually two problems. First, the bounds in Int64.toIntOpt are just plain wrong, and different from the other version of the method. Second, the Int type is implemented using OCaml's int in the interpreter, so its size is platform-dependent. It may be useful to expose the maximum and minimum integers in the standard library, and defining these values in one place should help implement integer conversions consistently.

@forell forell added bug Something isn't working stdlib Work on standard library labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stdlib Work on standard library
Projects
None yet
Development

No branches or pull requests

1 participant