noname
noname copied to clipboard
constant-size arrays
const c_mul = 2;
fn main() -> [Field; 3 * c_mul + 1] {
return [1, 2, 3, 4, 5, 6, 7];
}
^ this example should compile. If it doesn't, we should ensure that it does :)
this should be already supported in the const generic PR https://github.com/zksecurity/noname/pull/147
maybe this issue should be about converting the current examples/const.no:
const player_one = 1;
const player_two = 2;
fn main(pub player: Field) -> Field {
assert_eq(player_one, player);
let next_player = player + 1;
assert_eq(player_two, next_player);
return next_player;
}
to something that uses const more? or adding another const example there
Agreed. It makes sense to add an array example with const variable as its size.