-
Notifications
You must be signed in to change notification settings - Fork 775
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
Adding fix to process 64 bit integers correctly. #5791
Conversation
Hello, please follow the contribution guide and include reference to the issue you're fixing. Also, please correct your PR so for tests to pass. |
ce1b7ef
to
c001488
Compare
c001488
to
74d321f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just had a few comments to look over
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the valid 64 bit integer -9,223,372,036,854,775,808 is treated as an invalid integer.
This is because for a negative integer, a unary operation token is created for the minus sign and an integer token is created for the integer. This integer token value is always positive.
When validating the integer value is within the range of a 64 bit integer, -9,223,372,036,854,775,808 fails because its integer token has a value of 9,223,372,036,854,775,808 and is greater than the max 64 bit integer 9,223,372,036,854,775,807.
Many approaches were thought of such as:
Finally, the only appropriate way thought of to handle this issue would be to create a dedicated visitor in the emit limitation calculator, which is after type checking. Here, we can choose to shortcut the syntax without affecting other processes such as type checking.
Fixes #5324