-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Labels
Description
It will be handy to directly obtain the length of an array variable.
For example
fn init_arr(const LEN: Field) -> [Field; LEN + 2] {
return [0; LEN + 2];
}
fn main() {
let arr = init_arr(10);
assert_eq(arr.len, 12);
// should also support being used to instantiate functions in mast phase
let arr2 = init_arr(arr.len);
assert_eq(arr2.len, 14);
}