v2 / vlib / v / checker / tests / assign_immutable_reference_var_err.out
14 lines · 14 sloc · 494 bytes · 6e63a22212c65a49734ed499ab6d92fef84ead48
Raw
1vlib/v/checker/tests/assign_immutable_reference_var_err.vv:8:11: notice: `x` is immutable, cannot have a mutable reference to an immutable object
2 6 |
3 7 | fn y(x &Foo) {
4 8 | mut m := x
5 | ^
6 9 | m.value = 42
7 10 | }
8vlib/v/checker/tests/assign_immutable_reference_var_err.vv:9:4: error: `m.value` aliases mutable data from an immutable value
9 7 | fn y(x &Foo) {
10 8 | mut m := x
11 9 | m.value = 42
12 | ~~~~~
13 10 | }
14 11 |
15