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: fix usage of `#[abi(tag)]` attribute with elaborator #5298

Closed TomAFrench closed 1 week ago

TomAFrench commented 1 week ago

Description

Problem*

Resolves

Summary*

Followup to #5292 to handle globals as well

Additional Context

Documentation*

Check one:

PR Checklist*

TomAFrench commented 1 week ago

Also needs a struct example as well

TomAFrench commented 1 week ago

We need to check that these actually end up in the build artifact as I ran into situations where it seems like they were still being omitted in the sync PR. I've had to turn off the elaborator for now in aztec-packages as a result.

TomAFrench commented 1 week ago

I wonder if we should differentiate "call this function" annotations from "mark this function". It is either that or give up on the warning entirely which can be confusing if the annotation is misspelled I think.

I agree that we shouldn't just assume that any custom attribute is a function which needs to be called. Is that how we're handling it atm?

jfecher commented 1 week ago

I agree that we shouldn't just assume that any custom attribute is a function which needs to be called. Is that how we're handling it atm?

If the function isn't callable we issue a warning that it wasn't found. This is only for "Custom" attributes. Otherwise it is very hard to tell the difference between an unknown word that is meant to be a marker and an unknown word that was a typo meant to call a function.