fix: add missing [Env] parameter to array map signature - #13500
Open
0x11semprez wants to merge 11 commits into
Open
fix: add missing [Env] parameter to array map signature#135000x11semprez wants to merge 11 commits into
0x11semprez wants to merge 11 commits into
Conversation
Contributor
|
Thank you for your contribution to the Noir language. Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch. Thanks for your understanding. |
0x11semprez
force-pushed
the
docs/map-env-param
branch
from
August 10, 2026 16:44
f5d39ee to
db0d259
Compare
Author
|
@TomAFrench please could you review my pr, if you have the time sir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: add missing [Env] parameter to array map signature
Summary
The documentation for the array
mapfunction does not show the[Env]parameter,while other functions of the same module (
for_each,for_eachi, ...) document it.The stdlib source does declare
[Env], and code relying on it compiles without anyerror, so this appears to be a documentation inconsistency rather than a library bug.
Location
noir/noir_stdlib/src/array/mod.nr
Line 45 in f078538
Signature shown in the docs (incorrect)
Signature declared in the stdlib (correct)
Note that there are two discrepancies: the missing
Envgeneric /fn[Env]closuretype, and
selfvs&self.For comparison —
for_each, documented correctlyReproduction
The following snippet compiles and passes:
The closure captures
testfrom its environment, so it cannot have typefn(T) -> Uas documented — a non-capturing function type. It is accepted,which confirms the real signature takes
fn[Env](T) -> U.Expected
The docs entry for
mapshould show the same[Env]parameter as the rest of themodule, and match the receiver used in the stdlib.
Environment
nargo --version>Additional notes
Happy to open a PR fixing the docs page if you point me to the source file.
semprez is happy