Array types using const arithmetic like [T; N + 1] parse and check fine in the struct definition, but fail when instantiated because (1 + 1) isn't reduced to 2 for type matching.
struct G1 {
pub x: u256,
pub y: u256,
}
struct Vk<const N: usize> {
pub ic: [G1; N + 1],
}
fn make_vk() -> Vk<1> {
Vk {
ic: [G1 { x: 3, y: 4 }, G1 { x: 5, y: 6 }],
}
}
error: expected `[G1; (1 + 1)]`, but `[G1; 2]` is given
Array types using const arithmetic like
[T; N + 1]parse and check fine in the struct definition, but fail when instantiated because(1 + 1)isn't reduced to2for type matching.