1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/dump_on_generic_func_test.v

25 lines
258 B
V

struct Aa {
sub AliasType
}
type AliasType = Bb
struct Bb {
a int
}
fn encode_struct[U](val U) {
dump(val)
println(val)
$for field in U.fields {
encode_struct(val.$(field.name))
}
}
fn test_main() {
aa := Aa{}
encode_struct(aa)
assert true
}