36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
vlib/v/checker/tests/array_or_map_assign_err.vv:3:5: error: use `array2 := array1.clone()` instead of `array2 := array1` (or use `unsafe`)
|
|
1 | fn main() {
|
|
2 | a1 := [1, 2, 3]
|
|
3 | a2 := a1
|
|
| ~~
|
|
4 | mut a3 := []int{}
|
|
5 | a3 = a1
|
|
vlib/v/checker/tests/array_or_map_assign_err.vv:5:5: error: use `array2 = array1.clone()` instead of `array2 = array1` (or use `unsafe`)
|
|
3 | a2 := a1
|
|
4 | mut a3 := []int{}
|
|
5 | a3 = a1
|
|
| ^
|
|
6 |
|
|
7 | m1 := {'one': 1}
|
|
vlib/v/checker/tests/array_or_map_assign_err.vv:8:8: error: cannot copy map: call `move` or `clone` method (or use a reference)
|
|
6 |
|
|
7 | m1 := {'one': 1}
|
|
8 | m2 := m1
|
|
| ~~
|
|
9 | mut m3 := map[string]int{}
|
|
10 | m3 = m1
|
|
vlib/v/checker/tests/array_or_map_assign_err.vv:10:7: error: cannot copy map: call `move` or `clone` method (or use a reference)
|
|
8 | m2 := m1
|
|
9 | mut m3 := map[string]int{}
|
|
10 | m3 = m1
|
|
| ~~
|
|
11 |
|
|
12 | _ = a2
|
|
vlib/v/checker/tests/array_or_map_assign_err.vv:25:8: error: cannot copy map: call `move` or `clone` method (or use a reference)
|
|
23 |
|
|
24 | fn foo(mut m map[string]int) {
|
|
25 | m2 := m
|
|
| ^
|
|
26 | m['foo'] = 100
|
|
27 | println(m)
|