v4 / vlib / v / checker / tests / mut_assign_ref.out
49 lines · 49 sloc · 1.66 KB · e995d991f1279d3cee90bc4ea022f6cbcbedba96
Raw
1vlib/v/checker/tests/mut_assign_ref.vv:10:12: error: `f` is immutable, cannot have a mutable reference to it
2 8 | fn main() {
3 9 | f := Foo{}
4 10 | mut pf := &f
5 | ^
6 11 | pf = &f
7 12 | p := &f
8vlib/v/checker/tests/mut_assign_ref.vv:11:7: error: `f` is immutable, cannot have a mutable reference to it
9 9 | f := Foo{}
10 10 | mut pf := &f
11 11 | pf = &f
12 | ^
13 12 | p := &f
14 13 | _ = p
15vlib/v/checker/tests/mut_assign_ref.vv:15:11: error: cannot have mutable reference to const `constant`
16 13 | _ = p
17 14 |
18 15 | mut c := &constant
19 | ^
20 16 | c.value = 200
21 17 | c = &constant
22vlib/v/checker/tests/mut_assign_ref.vv:15:11: error: `constant` is immutable, cannot have a mutable reference to it
23 13 | _ = p
24 14 |
25 15 | mut c := &constant
26 | ^
27 16 | c.value = 200
28 17 | c = &constant
29vlib/v/checker/tests/mut_assign_ref.vv:17:6: error: cannot have mutable reference to const `constant`
30 15 | mut c := &constant
31 16 | c.value = 200
32 17 | c = &constant
33 | ^
34 18 | ic := &constant
35 19 | _ = ic
36vlib/v/checker/tests/mut_assign_ref.vv:17:6: error: `constant` is immutable, cannot have a mutable reference to it
37 15 | mut c := &constant
38 16 | c.value = 200
39 17 | c = &constant
40 | ^
41 18 | ic := &constant
42 19 | _ = ic
43vlib/v/checker/tests/mut_assign_ref.vv:18:8: error: cannot have mutable reference to const `constant`
44 16 | c.value = 200
45 17 | c = &constant
46 18 | ic := &constant
47 | ^
48 19 | _ = ic
49 20 |
50