v2 / vlib / v / parser / tests / const_index.vv
21 lines · 15 sloc · 213 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1// must not parse 4[deprecated] as index expression
2const x = 4
3
4@[deprecated]
5fn g() {
6 a := [3]
7 _ = a[0]
8}
9
10const y = 5
11
12@[deprecated]
13fn h() {}
14
15const z = 6
16
17@[typedef]
18pub struct C.Foo {}
19
20a := [3]
21_ := a[0]
22