v2 / vlib / v / checker / tests / fixed_array_conv.out
62 lines · 62 sloc · 2.25 KB · 7d57a19d7e4924b0da97185fefb4191e677d2639
Raw
1vlib/v/checker/tests/fixed_array_conv.vv:3:5: notice: left-side of assignment expects a mutable reference, but variable `arr` is immutable, declare it with `mut` to make it mutable or clone it
2 1 | arr := [2, 3]!
3 2 | mut p := unsafe { nil }
4 3 | p = arr
5 | ~~~
6 4 | mut ip := &int(unsafe { nil })
7 5 | ip = arr
8vlib/v/checker/tests/fixed_array_conv.vv:5:6: notice: left-side of assignment expects a mutable reference, but variable `arr` is immutable, declare it with `mut` to make it mutable or clone it
9 3 | p = arr
10 4 | mut ip := &int(unsafe { nil })
11 5 | ip = arr
12 | ~~~
13 6 | _ = &int(arr)
14 7 | _ = p
15vlib/v/checker/tests/fixed_array_conv.vv:6:5: warning: cannot cast a fixed array (use e.g. `&arr[0]` instead)
16 4 | mut ip := &int(unsafe { nil })
17 5 | ip = arr
18 6 | _ = &int(arr)
19 | ~~~~~~~~~
20 7 | _ = p
21 8 | _ = ip
22vlib/v/checker/tests/fixed_array_conv.vv:3:3: error: mismatched types `voidptr` and `[2]int`
23 1 | arr := [2, 3]!
24 2 | mut p := unsafe { nil }
25 3 | p = arr
26 | ^
27 4 | mut ip := &int(unsafe { nil })
28 5 | ip = arr
29vlib/v/checker/tests/fixed_array_conv.vv:3:5: error: cannot assign to `p`: expected `voidptr`, not `[2]int`
30 1 | arr := [2, 3]!
31 2 | mut p := unsafe { nil }
32 3 | p = arr
33 | ~~~
34 4 | mut ip := &int(unsafe { nil })
35 5 | ip = arr
36vlib/v/checker/tests/fixed_array_conv.vv:5:4: error: mismatched types `&int` and `[2]int`
37 3 | p = arr
38 4 | mut ip := &int(unsafe { nil })
39 5 | ip = arr
40 | ^
41 6 | _ = &int(arr)
42 7 | _ = p
43vlib/v/checker/tests/fixed_array_conv.vv:5:6: error: cannot assign to `ip`: expected `&int`, not `[2]int`
44 3 | p = arr
45 4 | mut ip := &int(unsafe { nil })
46 5 | ip = arr
47 | ~~~
48 6 | _ = &int(arr)
49 7 | _ = p
50vlib/v/checker/tests/fixed_array_conv.vv:12:10: error: cannot use `[2]int` as `&u8` in argument 1 to `tos`
51 10 | unsafe {
52 11 | _ = memdup(arr, 1)
53 12 | _ = tos(arr, 1)
54 | ~~~
55 13 | fn (p &int) {}(arr)
56 14 | }
57vlib/v/checker/tests/fixed_array_conv.vv:13:17: error: cannot use `[2]int` as `&int` in argument 1 to `anon`
58 11 | _ = memdup(arr, 1)
59 12 | _ = tos(arr, 1)
60 13 | fn (p &int) {}(arr)
61 | ~~~
62 14 | }
63