Closed TomAFrench closed 4 months ago
use dep::std::field::modulus_be_bytes;
global BN254_MODULUS_BE_BYTES: [u8] = &[
48, 100, 78, 114, 225, 49, 160, 41, 184, 80, 69, 182, 129, 129, 88, 93, 40, 51, 232, 72, 121, 185, 112, 145, 67, 225, 245, 147, 240, 0, 0, 1
];
fn main() -> pub bool {
dep::std::field::modulus_be_bytes() == BN254_MODULUS_BE_BYTES
}
This can also be run into when just checking equality between two slices
We used to encounter this a lot when array literals & types were polymorphic over arrays and structs. Not sure why it is happening now.
Aim
I would like to write a very simple program which just returns the modulus of the field being used.
Expected Behavior
I would expect that this program would successfully compile and I would get ACIR which directly commits to the values of each public input.
Bug
Compilation fails with a panic inside the inlining pass.
To Reproduce
1. 2. 3. 4.
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
I can work around this by directly inlining the contents of
as_array
into my function as so.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