-
Notifications
You must be signed in to change notification settings - Fork 388
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
boolean operators (||
, &&
) allowed in return values (for non-boolean return values)
#1083
Milestone
Comments
thehowl
added
🐞 bug
Something isn't working
📦 🤖 gnovm
Issues or PRs gnovm related
labels
Aug 30, 2023
thehowl
changed the title
boolean operators (
boolean operators (Aug 30, 2023
||
, &&
) allowed in return values||
, &&
) allowed in return values (for non-boolean return values)
7 tasks
7 tasks
jaekwon
pushed a commit
that referenced
this issue
Dec 18, 2023
<!-- please provide a detailed description of the changes made in this pull request. --> Addresses #1083 This fixes an issue where there was no enforcement of operand types when doing boolean operations. The correct approach should be to verify boolean operand type expressions also evaluate to boolean typed values before proceeding. This prevents any of the behavior described in the issue that this PR addresses. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
gfanton
pushed a commit
to moul/gno
that referenced
this issue
Jan 18, 2024
<!-- please provide a detailed description of the changes made in this pull request. --> Addresses gnolang#1083 This fixes an issue where there was no enforcement of operand types when doing boolean operations. The correct approach should be to verify boolean operand type expressions also evaluate to boolean typed values before proceeding. This prevents any of the behavior described in the issue that this PR addresses. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example:
this program executes with
gno run
with the following output:It seems to me that only the first expression is evaluated & returned.
I first discovered this as I made a typo in this function. I intended to do a bitwise OR, then I noticed some weird behaviour elsewhere and noticed that the return expression contained this
||
while it was not allowed.(Part of a series of issues encountered while developing gnochess)
The text was updated successfully, but these errors were encountered: