Files
circ/scripts/zx_tests/struct_generic.zx
2022-03-25 15:03:09 -07:00

19 lines
349 B
Plaintext

struct Bar<N> {
field[N] c
bool d
}
struct Foo<P> {
Bar<P> a
bool b
}
// const Bar<2> VAR_B = Bar{ c: [0, 0], d: false }
def main() -> (Foo<2>):
Bar<2> var_b = Bar{ c: [0, 0], d: false }
// Bar<2> var_b = VAR_B
Foo<2>[2] f = [Foo { a: var_b, b: true}, Foo { a: var_b, b: true}]
f[0].a.c = [42, 43]
return f[0]