chore: Fix unconstrained function example #6391
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This both fixes syntax errors and updates the unconstrained function example in the docs.
Summary
u72
withu64
, as of noirc version0.36.0+60c770f5f2594eea31ac75c852980edefa40d9eb
0.36.0+60c770f5f2594eea31ac75c852980edefa40d9eb
Additional Context
This block appears to come from a Discord post from July 2023, the
u72
data type is rejected by the compiler as of this PR, so this was replaced with au64
. This of course changes the compiler output, but there was originally three steps of optimization: simple example, earlier cast, and unconstrained. The middle step, casting earlier, does not appear to reduce the number of ACIR opcodes anymore, I assume because of compiler optimization improvements, so this middle step was removed and wording was changed to accommodate this.Also, can we remove the Discord link? If a reader is not in the Noir Discord server, the link leads to a blank page and offers no intuitive means to join the Discord server. If this is a means to drive Discord traffic, I would consider a link to join the server there rather than only in the page footer.
Documentation
Check one:
PR Checklist*
cargo fmt
on default settings.