Skip to content

fix(expand): better handling of dereferences (again)#9654

Merged
vezenovm merged 1 commit intomasterfrom
ab/nargo_expand_more_dereferences_fixes
Aug 27, 2025
Merged

fix(expand): better handling of dereferences (again)#9654
vezenovm merged 1 commit intomasterfrom
ab/nargo_expand_more_dereferences_fixes

Conversation

@asterite
Copy link
Collaborator

Description

Problem

Resolves #9581

Summary

The logic for printing dereferences in l-values was still wrong. In some cases it missed a parentheses, in many cases it added parentheses for no reasons. I ended up with a code that prints dereferences with the minimum number of parentheses, if you look at the snapshots diff. So this is a fix but also an enhancement.

Additional Context

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@asterite asterite requested a review from vezenovm August 27, 2025 14:19
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: c96f608 Previous: 46e3595 Ratio
test_report_zkpassport_noir-ecdsa_ 3 s 1 s 3

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@vezenovm vezenovm enabled auto-merge August 27, 2025 14:39
@vezenovm vezenovm added this pull request to the merge queue Aug 27, 2025
Merged via the queue into master with commit cc0c20d Aug 27, 2025
122 checks passed
@vezenovm vezenovm deleted the ab/nargo_expand_more_dereferences_fixes branch August 27, 2025 15:04
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Aug 28, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix: make Ord for slices lexicographic (elements first, then length)
(noir-lang/noir#9555)
chore(ssa): Refactor `unrolling`
(noir-lang/noir#9653)
chore(docs): Update dependency page's examples
(noir-lang/noir#9634)
fix(ssa): Constant fold Brillig calls using the SSA interpreter
(noir-lang/noir#9655)
chore: LICM refactors (noir-lang/noir#9642)
chore: add test for trait bound on implementing type
(noir-lang/noir#9652)
chore: pass `DataFlowGraph` instead of `Function` as arg
(noir-lang/noir#9656)
feat: Group one audit tests
(noir-lang/noir#9445)
fix(expand): better handling of dereferences (again)
(noir-lang/noir#9654)
feat(mem2reg): address last known value is independent of its aliases
(take three) (noir-lang/noir#9633)
chore: remove handling for slice arguments to MSM
(noir-lang/noir#9648)
fix: validate binary operations which do not allow fields
(noir-lang/noir#9649)
END_COMMIT_OVERRIDE
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Aug 28, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix: make Ord for slices lexicographic (elements first, then length)
(noir-lang/noir#9555)
chore(ssa): Refactor `unrolling`
(noir-lang/noir#9653)
chore(docs): Update dependency page's examples
(noir-lang/noir#9634)
fix(ssa): Constant fold Brillig calls using the SSA interpreter
(noir-lang/noir#9655)
chore: LICM refactors (noir-lang/noir#9642)
chore: add test for trait bound on implementing type
(noir-lang/noir#9652)
chore: pass `DataFlowGraph` instead of `Function` as arg
(noir-lang/noir#9656)
feat: Group one audit tests
(noir-lang/noir#9445)
fix(expand): better handling of dereferences (again)
(noir-lang/noir#9654)
feat(mem2reg): address last known value is independent of its aliases
(take three) (noir-lang/noir#9633)
chore: remove handling for slice arguments to MSM
(noir-lang/noir#9648)
fix: validate binary operations which do not allow fields
(noir-lang/noir#9649)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nargo expand removes parentheses for nested dereferences

2 participants