noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
821 stars 177 forks source link

fix: update `in_contract` flag before handling function metadata in elaborator #5292

Closed TomAFrench closed 1 week ago

TomAFrench commented 1 week ago

Description

Problem*

Resolves #5288

Summary*

This PR fixes #5288 by updating self.in_contract before we define function metadata to match self.local_module. This is mildly hacky and we may want to have a nicer "switch modules and update everything which depends on it" helper function in future.

Additional Context

Documentation*

Check one:

PR Checklist*