-
Notifications
You must be signed in to change notification settings - Fork 204
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
Allow casting bools to integers (and vice-versa) #278
Conversation
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.
Added some changes to be made
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 to work functionally. Made a basic Noir example using this branch's nargo build that follows the one Kev wrote in issue #277
* cast bool example * remove proofs folder in example, accidentally committed
It's OK for me, I let @kevaundray validate it because it's mostly frontend. |
Fixes #277.
It also turns out we never parsed the bool type either, so I added support for parsing it.
Bool was also the only primitive type not to have constness tracked so I added that as well. Previously if you had a constant and casted it to a boolean and back the compiler would treat it as non-const. Now it will correctly recognize it as still const and allow it to be used as an index.