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

Unsigned integers no wrap II #2189

Merged
merged 8 commits into from
Jul 19, 2023
Merged

Conversation

Shaikh-Ubaid
Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid commented Jul 19, 2023

fixes #2173

towards #2176 (comment)

--> tests/errors/unsigned_02.py:3:10
|
3 | i: u16 = -u16(5)
| ^^^^^^^ use -i32(u) for signed result
Copy link
Contributor

@certik certik Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if it could copy the actual expression inside:

Suggested change
| ^^^^^^^ use -i32(u) for signed result
| ^^^^^^^ use -i32(5) for signed result

But I guess for that we would have to have an ASR -> Python printer, which we plan to, but not right now. So we can do that later.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@Shaikh-Ubaid
Copy link
Collaborator Author

Thank you so much for the quick review!

@Shaikh-Ubaid Shaikh-Ubaid merged commit 0001e55 into lcompilers:main Jul 19, 2023
9 checks passed
@Shaikh-Ubaid Shaikh-Ubaid deleted the unsigned_ints branch July 19, 2023 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In emulation mode, u8-u64 should be represented by just int
2 participants