v4 / vlib / v / checker / tests / invalid_insert_references_test.out
14 lines · 14 sloc · 509 bytes · 690ec7d3a581719fb68c70fddd45b5d31fcae38b
Raw
1vlib/v/checker/tests/invalid_insert_references_test.vv:4:12: warning: cannot add a reference to an immutable object to a mutable array
2 2 | fn test_invalid_insert_references() {
3 3 | b := 0
4 4 | mut a := [&b]
5 | ^
6 5 | mut c := 1
7 6 | a << &c
8vlib/v/checker/tests/invalid_insert_references_test.vv:8:7: error: cannot append `int literal` to `[]&int`
9 6 | a << &c
10 7 | c = 2
11 8 | a << 1
12 | ^
13 9 | println(a)
14 10 | }
15