v2 / vlib / v / checker / tests / array_init_option_err.out
33 lines · 33 sloc · 1.25 KB · 1512486d01d4205e7b67ebd679238fa45cd348af
Raw
1vlib/v/checker/tests/array_init_option_err.vv:2:38: error: cannot use unwrapped Option as initializer
2 1 | fn main() {
3 2 | mut arr1 := []int{len: get(), init: get()}
4 | ~~~~~
5 3 | dump(arr1)
6 4 |
7vlib/v/checker/tests/array_init_option_err.vv:2:25: error: cannot use unwrapped Option as length
8 1 | fn main() {
9 2 | mut arr1 := []int{len: get(), init: get()}
10 | ~~~~~
11 3 | dump(arr1)
12 4 |
13vlib/v/checker/tests/array_init_option_err.vv:5:20: error: cannot use unwrapped Option as length
14 3 | dump(arr1)
15 4 |
16 5 | arr1 = []int{len: get(), init: get()?}
17 | ~~~~~
18 6 | dump(arr1)
19 7 |
20vlib/v/checker/tests/array_init_option_err.vv:8:34: error: cannot use unwrapped Option as initializer
21 6 | dump(arr1)
22 7 |
23 8 | arr1 = []int{len: get()?, init: get()}
24 | ~~~~~
25 9 | dump(arr1)
26 10 |
27vlib/v/checker/tests/array_init_option_err.vv:11:20: error: cannot use unwrapped Option as capacity
28 9 | dump(arr1)
29 10 |
30 11 | arr1 = []int{cap: get(), len: get()?, init: get()?}
31 | ~~~~~
32 12 | dump(arr1)
33 13 | }
34