v2 / vlib / v / checker / tests / array_init_without_init_value_err.out
70 lines · 70 sloc · 3.6 KB · 2dce525d90ca36715367ad565916961c088cef25
Raw
1vlib/v/checker/tests/array_init_without_init_value_err.vv:5:7: warning: arrays of sumtypes need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
2 3 |
3 4 | fn main_sum_type() {
4 5 | a := []Foo{len: 10}
5 | ~~~~~~
6 6 | println(a)
7 7 | fixed_a := [10]Foo{}
8vlib/v/checker/tests/array_init_without_init_value_err.vv:7:13: warning: fixed arrays of sumtypes need to be initialized right away (unless inside `unsafe`)
9 5 | a := []Foo{len: 10}
10 6 | println(a)
11 7 | fixed_a := [10]Foo{}
12 | ~~~~~~~~~
13 8 | println(fixed_a)
14 9 | }
15vlib/v/checker/tests/array_init_without_init_value_err.vv:20:11: warning: arrays of references need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
16 18 | // test references uninitialized.
17 19 | fn main_ref() {
18 20 | println(*[]&int{len: 1}[0])
19 | ~~~~~~~
20 21 | println([1]&int{})
21 22 | _ = [][1]&int{len: 1}[0][0]
22vlib/v/checker/tests/array_init_without_init_value_err.vv:21:10: warning: fixed arrays of references need to be initialized right away (unless inside `unsafe`)
23 19 | fn main_ref() {
24 20 | println(*[]&int{len: 1}[0])
25 21 | println([1]&int{})
26 | ~~~~~~~~~
27 22 | _ = [][1]&int{len: 1}[0][0]
28 23 | _ = []map[int]&int{len: 1}
29vlib/v/checker/tests/array_init_without_init_value_err.vv:22:6: warning: arrays of references need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
30 20 | println(*[]&int{len: 1}[0])
31 21 | println([1]&int{})
32 22 | _ = [][1]&int{len: 1}[0][0]
33 | ~~~~~~~~~~
34 23 | _ = []map[int]&int{len: 1}
35 24 | }
36vlib/v/checker/tests/array_init_without_init_value_err.vv:23:6: warning: arrays of references need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
37 21 | println([1]&int{})
38 22 | _ = [][1]&int{len: 1}[0][0]
39 23 | _ = []map[int]&int{len: 1}
40 | ~~~~~~~~~~~~~~~
41 24 | }
42 25 |
43vlib/v/checker/tests/array_init_without_init_value_err.vv:40:22: warning: arrays of interfaces need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
44 38 |
45 39 | fn main_interface() {
46 40 | mut parsed_lines := []MObject{len: 9}
47 | ~~~~~~~~~~
48 41 | println(parsed_lines)
49 42 | }
50vlib/v/checker/tests/array_init_without_init_value_err.vv:12:7: warning: arrays of sumtypes need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
51 10 |
52 11 | fn main_sum_type_2[T]() {
53 12 | a := []T{len: 10}
54 | ~~~~
55 13 | println(a)
56 14 | fixed_a := [10]T{}
57vlib/v/checker/tests/array_init_without_init_value_err.vv:14:13: warning: fixed arrays of sumtypes need to be initialized right away (unless inside `unsafe`)
58 12 | a := []T{len: 10}
59 13 | println(a)
60 14 | fixed_a := [10]T{}
61 | ~~~~~~~
62 15 | println(fixed_a)
63 16 | }
64vlib/v/checker/tests/array_init_without_init_value_err.vv:45:22: warning: arrays of interfaces need to be initialized right away, therefore `len:` cannot be used (unless inside `unsafe`, or if you also use `init:`)
65 43 |
66 44 | fn main_interface_2[T]() {
67 45 | mut parsed_lines := []T{len: 9}
68 | ~~~~
69 46 | println(parsed_lines)
70 47 | }
71