1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/struct_generic_inference.zok
2022-06-01 00:04:40 +02:00

17 lines
301 B
Text

struct SomeStruct<N> {
u64[N] f;
}
def myFct<N, N2, N3>(SomeStruct<N> ignored) -> u32[N2] {
assert(2*N == N2);
return [N3; N2];
}
const u32 N = 3;
const u32 N2 = 2*N;
def main(SomeStruct<N> arg) -> u32 {
u32[N2] someVariable = myFct::<_, _, 42>(arg);
return someVariable[0];
}