v2 / vlib / v / checker / tests / assign_const_ptr_int_literal_err.out
16 lines · 16 sloc · 533 bytes · e995d991f1279d3cee90bc4ea022f6cbcbedba96
Raw
1vlib/v/checker/tests/assign_const_ptr_int_literal_err.vv:4:8: error: cannot assign a pointer to a constant with an integer literal value
2 2 |
3 3 | fn main() {
4 4 | b := &a
5 | ^
6 5 | dump(b)
7 6 | }
8Details: Specify the type for the constant value. Example:
9 `const a = int(3)`
10vlib/v/checker/tests/assign_const_ptr_int_literal_err.vv:4:7: error: cannot have mutable reference to const `a`
11 2 |
12 3 | fn main() {
13 4 | b := &a
14 | ^
15 5 | dump(b)
16 6 | }
17