mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
25 lines
258 B
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
|
|
}
|