vxx2 / vlib / v / checker / tests / option_var_unwrap_err.out
21 lines · 21 sloc · 703 bytes · 1512486d01d4205e7b67ebd679238fa45cd348af
Raw
1vlib/v/checker/tests/option_var_unwrap_err.vv:5:9: error: to propagate the Option, `abc_2` must return an Option type
2 3 |
3 4 | fn abc_2(a ?string) string {
4 5 | return a?
5 | ^
6 6 | }
7 7 |
8Details: vlib/v/checker/tests/option_var_unwrap_err.vv:4:21: details: prepend ? before the declaration of the return type of `abc_2`
9 2 | }
10 3 |
11 4 | fn abc_2(a ?string) string {
12 | ~~~~~~
13 5 | return a?
14 6 | }
15vlib/v/checker/tests/option_var_unwrap_err.vv:5:2: error: should not unwrap option var on return, it could be none
16 3 |
17 4 | fn abc_2(a ?string) string {
18 5 | return a?
19 | ~~~~~~~~
20 6 | }
21 7 |
22