Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
structs
/
struct_shared_field_init_test.v
22
lines
·
19
sloc
·
195 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
AA {
2
b shared BB
3
}
4
5
struct
BB {
6
a &int
7
}
8
9
struct
CC {
10
a BB
11
}
12
13
fn
test_struct_shared_field_init() {
14
a := 3
15
table := &AA{
16
b: BB{&a}
17
}
18
c := CC{
19
a: table.b
20
}
21
assert *c.a.a == 3
22
}
23