Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
checker
/
tests
/
assign_enum_at_comptime.vv
15
lines
·
12
sloc
·
166 bytes
·
d1306ffcf528b5d901603d777dfa15d108ef29ea
Raw
1
enum TestEnum {
2
one = 1
3
}
4
5
struct TestStruct {
6
test TestEnum
7
}
8
9
fn main() {
10
mut t := TestStruct{}
11
12
$for field in TestStruct.fields {
13
t.$(field.name) = '1'
14
}
15
}
16