v2 / vlib / v / checker / tests / array_or_map_assign_err.out
42 lines · 42 sloc · 1.65 KB · 7d47219808f5517417290f4bbae4bc1fda35e5ba
Raw
1vlib/v/checker/tests/array_or_map_assign_err.vv:5:7: notice: left-side of assignment expects a mutable reference, but variable `a1` is immutable, declare it with `mut` to make it mutable or clone it
2 3 | a2 := a1
3 4 | mut a3 := []int{}
4 5 | a3 = a1
5 | ~~
6 6 |
7 7 | m1 := {
8vlib/v/checker/tests/array_or_map_assign_err.vv:12:7: notice: left-side of assignment expects a mutable reference, but variable `m1` is immutable, declare it with `mut` to make it mutable or clone it
9 10 | m2 := m1
10 11 | mut m3 := map[string]int{}
11 12 | m3 = m1
12 | ~~
13 13 |
14 14 | _ = a2
15vlib/v/checker/tests/array_or_map_assign_err.vv:5:5: error: use `array2 = array1.clone()` instead of `array2 = array1` (or use `unsafe`)
16 3 | a2 := a1
17 4 | mut a3 := []int{}
18 5 | a3 = a1
19 | ^
20 6 |
21 7 | m1 := {
22vlib/v/checker/tests/array_or_map_assign_err.vv:10:8: error: cannot copy map: call `move` or `clone` method (or use a reference)
23 8 | 'one': 1
24 9 | }
25 10 | m2 := m1
26 | ~~
27 11 | mut m3 := map[string]int{}
28 12 | m3 = m1
29vlib/v/checker/tests/array_or_map_assign_err.vv:12:7: error: cannot copy map: call `move` or `clone` method (or use a reference)
30 10 | m2 := m1
31 11 | mut m3 := map[string]int{}
32 12 | m3 = m1
33 | ~~
34 13 |
35 14 | _ = a2
36vlib/v/checker/tests/array_or_map_assign_err.vv:29:8: error: cannot copy map: call `move` or `clone` method (or use a reference)
37 27 |
38 28 | fn foo(mut m map[string]int) {
39 29 | m2 := m
40 | ^
41 30 | m['foo'] = 100
42 31 | println(m)
43