v2 / vlib / v / tests / options / option_nested_struct_test.v
15 lines · 14 sloc · 189 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Node {
2mut:
3 next ?&Node
4}
5
6fn test_struct_nested_option() {
7 mut b := Node{}
8 mut a := Node{
9 next: &b
10 }
11 dump(a)
12 dump(a.next)
13 dump(a.next?.next)
14 assert a.next?.next == none
15}
16