v2 / vlib / v / checker / tests / assign_enum_at_comptime.vv
15 lines · 12 sloc · 166 bytes · d1306ffcf528b5d901603d777dfa15d108ef29ea
Raw
1enum TestEnum {
2 one = 1
3}
4
5struct TestStruct {
6 test TestEnum
7}
8
9fn main() {
10 mut t := TestStruct{}
11
12 $for field in TestStruct.fields {
13 t.$(field.name) = '1'
14 }
15}
16