v4 / vlib / v / checker / tests / option_ptr_err.out
12 lines · 12 sloc · 497 bytes · 052d862244e04dec20582eec248e5cb548060cc4
Raw
1vlib/v/checker/tests/option_ptr_err.vv:3:10: error: type `?int` is an Option, it must be unwrapped first; use `*var?` to do it
2 1 | fn main() {
3 2 | mut var := unsafe { ?&int(none) }
4 3 | assert *var == 0
5 | ~~~
6 4 | }
7vlib/v/checker/tests/option_ptr_err.vv:3:9: error: `?int` cannot be used as `int literal`, unwrap the option first
8 1 | fn main() {
9 2 | mut var := unsafe { ?&int(none) }
10 3 | assert *var == 0
11 | ^
12 4 | }
13