We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in fn main(x: u32, y: pub u32), doing (x == 2), (x < 2) and (x > 2) all yield true. This is leading to every if, else part getting executed.
This should clearly not be the case. However, constraints are working since constraint (x <= 2) seems to work just fine.
Each comparison with x is leading to a true case, which effectively short circuits the conditional statements.
Binary
nargo 0.5.0
No response
The text was updated successfully, but these errors were encountered:
@vezenovm is checking if this is fixed
Sorry, something went wrong.
Using the repo provided in the issue I added printlns inside each conditional:
if (p == 0){ if (q == 1){ std::println("Player 2 wins!"); res = 2; } if (q == 2){ std::println("Player 1 wins!"); res = 1; } } if (p == 1){ if (q == 0){ std::println("Player 1 wins!"); res = 1; } if (q == 2){ std::println("Player 2 wins!"); res = 2; } } if (p == 2){ if (q == 0){ std::println("Player 2 wins!"); res = 2; } if (q == 1){ std::println("It's a draw!"); res = 1; } }
When using the new experimental ssa (nargo prove p --experimental-ssa) this is only now printing
nargo prove p --experimental-ssa
"Player 2 wins!" "0x02"
versus every case being printed with just nargo prove p --show-output.
nargo prove p --show-output
Marking this issue as resolved
vezenovm
No branches or pull requests
Aim
in fn main(x: u32, y: pub u32), doing (x == 2), (x < 2) and (x > 2) all yield true. This is leading to every if, else part getting executed.
Expected behavior
This should clearly not be the case. However, constraints are working since constraint (x <= 2) seems to work just fine.
Bug
Each comparison with x is leading to a true case, which effectively short circuits the conditional statements.
To reproduce
Installation method
Binary
Nargo version
nargo 0.5.0
@noir-lang/noir_wasm version
No response
@noir-lang/barretenberg version
No response
@noir-lang/aztec_backend version
No response
Additional context
No response
Submission Checklist
The text was updated successfully, but these errors were encountered: