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

23 lines
195 B
V

struct AA {
b shared BB
}
struct BB {
a &int
}
struct CC {
a BB
}
fn test_struct_shared_field_init() {
a := 3
table := &AA{
b: BB{&a}
}
c := CC{
a: table.b
}
assert *c.a.a == 3
}