-
Notifications
You must be signed in to change notification settings - Fork 223
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
Example code is missing pub
keywords in returns
#3452
Comments
Nothing? Nobody interested? |
Hi @microbecode, thanks for opening this issue. The example you've posted is actually valid Noir, I've removed the public argument to |
Thanks! So problem solved. |
# Description ## Problem\* Resolves #3452 ## Summary\* This PR makes two changes in the docs: 1. I've removed the visibility modifier on an argument to the non-entrypoint function `foo`. This code would compile but would also raise a warning on `pub` being unnecessary and misleading so we should just remove it. 2. `pub` was missing on a `main` function return value in `7_mutability.md`. ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [x] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
Aim
Many of the examples in the documentation state something like this:
However, this syntax does not seem to be accepted (anymore). The return value should have the
pub
keyword.Should this issue be listed as a 'bug' or an 'idea'? Dunno.
Expected Behavior
I expect the example codes to work.
Bug
Without the
pub
keyword I get error:The
pubkeyword is mandatory for the entry-point function return type because the verifier cannot retrieve private witness and thus the function will not be able to return a 'priv' value
To Reproduce
Installation Method
Binary
Nargo Version
nargo 0.17 86704ba
Additional Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: