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

implicit cast on division turns negative argument into bit<> and typechecks #195

Open
hackedy opened this issue May 12, 2020 · 1 comment

Comments

@hackedy
Copy link
Collaborator

hackedy commented May 12, 2020

Right now implicit casts for binary operations (following the spec) will turn something like 8w20 / (-2) into 8w20 / 8w254, which typechecks. I'm making exceptions in implicit casts for shifts right now to avoid similar problems but division is already convoluted enough.

@hackedy
Copy link
Collaborator Author

hackedy commented May 12, 2020

For an example: examples/checker_tests/bad/div1.p4

@hackedy hackedy assigned hackedy and unassigned hackedy Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant