noir-lang / noir

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

Elaborator doesn't correctly detect we are in_contract #5288

Closed Thunkar closed 3 months ago

Thunkar commented 3 months ago

Aim

Compile aztec packages with the new elaborator

Expected Behavior

contract ElaboratorContract {
    #[recursive]
    fn contract_entrypoint() -> Field {
        1
    }
}

This should compile

Bug

The new elaborator doesn't correctly detect we are inside a contract, and as such every check for entrypoint functions fail. Most obvious errors come from trying to use attributes such as #[recursive] or #[abi(tag)]

To Reproduce

Try to compile the example above, the compiler will return Screenshot 2024-06-19 at 12 03 31

Project Impact

Blocker

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

Compiled from source

Nargo Version

No response

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response