v2 / vlib / v / fmt / tests / struct_fixed_array_enum_cast_keep.vv
16 lines · 13 sloc · 165 bytes · fc8ef0e70cdb75713db4cc149df78cc1fb5e95fe
Raw
1module main
2
3enum TestEnum {
4 one
5 two
6 _max
7}
8
9struct Test1 {
10 list [int(TestEnum._max)]int
11}
12
13fn main() {
14 t := Test1{}
15 assert t.list.len == int(TestEnum._max)
16}
17