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
if
let some_condition = false; // for example's sake let mut my_tuple: (bool, bool) = (false, false); if some_condition { my_tuple.0 = true; else { my_tuple.0 = false; }
This compilation fails with:
error: Expected an expression but found = ... my_tuple.0 = true;
If I replace the tuple (bool, bool) with an array [bool; 2] and access via my_tuple[0], it compiles.
(bool, bool)
[bool; 2]
my_tuple[0]
Note: My tuple was actually made up of structs, rather than bools, but I distilled it down to this, for simplicity.
bool
I'm using the aztec3-hacky branch, so it could be because of that...?
aztec3-hacky
Expected it to be able to assign to the element of the tuple.
See section above.
None
nargo 0.4.0 (git version hash: 22c2234, is dirty: false)
No response
The text was updated successfully, but these errors were encountered:
Possibly, it would be good to check that this is a bug on master too
Sorry, something went wrong.
Just checked with v0.4.1:
fn main(my_tuple: (bool, bool), some_condition: bool) -> pub (bool, bool) { if some_condition { my_tuple.0 = true; } else { my_tuple.0 = false; } my_tuple }
error: Expected an expression but found = ┌─ /mnt/user-data/mike/packages/yarn-project/noir-contracts/src/contracts/mike-play/src/main.nr:27:20 │ 27 │ my_tuple.0 = true; │ - error: Expected an expression but found = ┌─ /mnt/user-data/mike/packages/yarn-project/noir-contracts/src/contracts/mike-play/src/main.nr:29:20 │ 29 │ my_tuple.0 = false; │ - error: aborting due to 2 previous errors Error: Failed to compile circuit
Worth noting this fails without the if as well - it seems we don't parse assigning to tuple fields at all.
jfecher
Successfully merging a pull request may close this issue.
Aim
This compilation fails with:
If I replace the tuple
(bool, bool)
with an array[bool; 2]
and access viamy_tuple[0]
, it compiles.Note: My tuple was actually made up of structs, rather than
bool
s, but I distilled it down to this, for simplicity.I'm using the
aztec3-hacky
branch, so it could be because of that...?Expected behavior
Expected it to be able to assign to the element of the tuple.
Bug
See section above.
To reproduce
Installation method
None
Nargo version
nargo 0.4.0 (git version hash: 22c2234, is dirty: false)
@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: