vxx2 / vlib / v / checker / tests / index_expr.out
75 lines · 75 sloc · 2.15 KB · f4cc3c19b2ca2c1a9ff19425fd30e498c2a38a02
Raw
1vlib/v/checker/tests/index_expr.vv:3:7: error: type `int` does not support indexing
2 1 | fn test_invalid_index() {
3 2 | v := 4
4 3 | _ = v[0]
5 | ~~~
6 4 |
7 5 | a := [2]
8vlib/v/checker/tests/index_expr.vv:6:8: error: non-integer index `[]int` (array type `[]int`)
9 4 |
10 5 | a := [2]
11 6 | _ = a[a]
12 | ^
13 7 | _ = a[-1]
14 8 | }
15vlib/v/checker/tests/index_expr.vv:7:8: error: negative index `-1`
16 5 | a := [2]
17 6 | _ = a[a]
18 7 | _ = a[-1]
19 | ~~
20 8 | }
21 9 |
22vlib/v/checker/tests/index_expr.vv:12:7: error: type `int` does not support indexing
23 10 | fn test_invalid_slice() {
24 11 | v := 4
25 12 | _ = v[1..]
26 | ~~~~~
27 13 | _ = v[..1]
28 14 |
29vlib/v/checker/tests/index_expr.vv:13:7: error: type `int` does not support indexing
30 11 | v := 4
31 12 | _ = v[1..]
32 13 | _ = v[..1]
33 | ~~~~~
34 14 |
35 15 | a := [2]
36vlib/v/checker/tests/index_expr.vv:16:8: error: non-integer index `[]int` (array type `[]int`)
37 14 |
38 15 | a := [2]
39 16 | _ = a[a..]
40 | ^
41 17 | _ = a[..a]
42 18 | _ = a[-1..]
43vlib/v/checker/tests/index_expr.vv:17:10: error: non-integer index `[]int` (array type `[]int`)
44 15 | a := [2]
45 16 | _ = a[a..]
46 17 | _ = a[..a]
47 | ^
48 18 | _ = a[-1..]
49 19 | _ = a[..-1]
50vlib/v/checker/tests/index_expr.vv:18:8: error: negative index `-1`
51 16 | _ = a[a..]
52 17 | _ = a[..a]
53 18 | _ = a[-1..]
54 | ~~
55 19 | _ = a[..-1]
56 20 | _ = a[-1..-2]
57vlib/v/checker/tests/index_expr.vv:19:10: error: negative index `-1`
58 17 | _ = a[..a]
59 18 | _ = a[-1..]
60 19 | _ = a[..-1]
61 | ~~
62 20 | _ = a[-1..-2]
63 21 | }
64vlib/v/checker/tests/index_expr.vv:20:8: error: negative index `-1`
65 18 | _ = a[-1..]
66 19 | _ = a[..-1]
67 20 | _ = a[-1..-2]
68 | ~~
69 21 | }
70vlib/v/checker/tests/index_expr.vv:20:12: error: negative index `-2`
71 18 | _ = a[-1..]
72 19 | _ = a[..-1]
73 20 | _ = a[-1..-2]
74 | ~~
75 21 | }
76