Skip to content

fix(frontend): follow aliases when matching method receivers - #13346

Draft
AztecBot wants to merge 3 commits into
masterfrom
cb/noir-audit-remediation-1055-method-reference-receivers
Draft

fix(frontend): follow aliases when matching method receivers#13346
AztecBot wants to merge 3 commits into
masterfrom
cb/noir-audit-remediation-1055-method-reference-receivers

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

Method receiver matching only tested the declared receiver type and one raw reference peel. That let alias-wrapped references and nested-reference inherent receivers miss the direct method path, allowing trait methods with the same name to win. This change centralizes receiver matching so it follows bindings and then repeatedly applies the existing auto-deref behavior.

Fix

  • Match method receiver types after following aliases and type bindings.
  • Keep peeling reference receiver layers until either the receiver matches or no reference remains.
  • Add regressions for alias-wrapped reference receivers, nested references, and generic reference aliases.

Testing

  • cargo test -p noirc_frontend inherent_method_ -- --nocapture
  • cargo fmt

Issues

  • Closes noir-lang/noir-claude#1055 — method receiver matching missed alias-wrapped and nested reference inherent methods

Created by claudebox · group: noir-audit-remediation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants