Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
printing
/
dump_on_generic_func_test.v
24
lines
·
19
sloc
·
258 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
Aa {
2
sub AliasType
3
}
4
5
type
AliasType = Bb
6
7
struct
Bb {
8
a int
9
}
10
11
fn
encode_struct[U](val U) {
12
dump(val)
13
println(val)
14
$
for
field
in
U.fields {
15
encode_struct(val.$(field.name))
16
}
17
}
18
19
fn
test_main() {
20
aa := Aa{}
21
22
encode_struct(aa)
23
assert
true
24
}
25