v2 / vlib / v / tests / indexexpr_or_test.v
14 lines · 12 sloc · 177 bytes · f7a0eeb65c0e881aa43313c80bd7461fd6e84f7a
Raw
1struct Element {
2 children []int
3}
4
5fn f() []Element {
6 return [Element{
7 children: [1, 2, 3]
8 }]
9}
10
11fn test_main() {
12 a := f()[0]!.children[0]!.str()
13 assert dump(a) == '1'
14}
15