vxx2 / vlib / v / checker / tests / or_block_smartcast_unwrapped_err.out
19 lines · 19 sloc · 895 bytes · a22727df147da930f7f0053aa1b61433f57e1471
Raw
1vlib/v/checker/tests/or_block_smartcast_unwrapped_err.vv:13:2: warning: unwrapping option is redundant as the function returns option
2 11 | return none
3 12 | }
4 13 | return name?
5 | ~~~~~~~~~~~
6 14 | }
7vlib/v/checker/tests/or_block_smartcast_unwrapped_err.vv:5:11: error: cannot use `or {}` block on non-option variable `name` (it was already unwrapped to `string` by an earlier none check; use `name` directly)
8 3 | return
9 4 | }
10 5 | name_ := name or { '' }.trim_space()
11 | ~~~~
12 6 | println(name_)
13 7 | }
14vlib/v/checker/tests/or_block_smartcast_unwrapped_err.vv:13:9: error: cannot use `?` on non-option variable `name` (it was already unwrapped to `string` by an earlier none check; use `name` directly)
15 11 | return none
16 12 | }
17 13 | return name?
18 | ~~~~
19 14 | }
20