vxx2 / vlib / v / checker / tests / nil_to_option_err.out
34 lines · 34 sloc · 1.1 KB · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1vlib/v/checker/tests/nil_to_option_err.vv:8:4: warning: cannot assign a reference to a value (this will be an error soon) left=int false right=nil true ptr=false
2 6 | fn main() {
3 7 | mut a := ?int(none)
4 8 | a = unsafe { nil }
5 | ^
6 9 |
7 10 | mut b := Test{}
8vlib/v/checker/tests/nil_to_option_err.vv:7:6: warning: unused variable: `a`
9 5 |
10 6 | fn main() {
11 7 | mut a := ?int(none)
12 | ^
13 8 | a = unsafe { nil }
14 9 |
15vlib/v/checker/tests/nil_to_option_err.vv:3:4: error: cannot assign `nil` to a non-pointer field
16 1 | struct Test {
17 2 | mut:
18 3 | a ?int = unsafe { nil }
19 | ~~~~
20 4 | }
21 5 |
22vlib/v/checker/tests/nil_to_option_err.vv:8:6: error: cannot assign `nil` to option value
23 6 | fn main() {
24 7 | mut a := ?int(none)
25 8 | a = unsafe { nil }
26 | ~~~~~~
27 9 |
28 10 | mut b := Test{}
29vlib/v/checker/tests/nil_to_option_err.vv:11:8: error: cannot assign `nil` to option value
30 9 |
31 10 | mut b := Test{}
32 11 | b.a = unsafe { nil }
33 | ~~~~~~
34 12 | }
35