vxx2 / vlib / v / checker / tests / unsafe_fixed_array_assign.out
20 lines · 20 sloc · 802 bytes · 6e63a22212c65a49734ed499ab6d92fef84ead48
Raw
1vlib/v/checker/tests/unsafe_fixed_array_assign.vv:10:10: notice: left-side of assignment expects a mutable reference, but variable `a` is immutable, declare it with `mut` to make it mutable or clone it
2 8 | }
3 9 | a := [&box]!
4 10 | mut b := a
5 | ^
6 11 | b[0].num = 0
7 12 | println(a)
8vlib/v/checker/tests/unsafe_fixed_array_assign.vv:10:7: error: assignment from one fixed array to another with a pointer element type is prohibited outside of `unsafe`
9 8 | }
10 9 | a := [&box]!
11 10 | mut b := a
12 | ~~
13 11 | b[0].num = 0
14 12 | println(a)
15vlib/v/checker/tests/unsafe_fixed_array_assign.vv:11:6: error: `b[0].num` aliases mutable data from an immutable value
16 9 | a := [&box]!
17 10 | mut b := a
18 11 | b[0].num = 0
19 | ~~~
20 12 | println(a)
21