v4 / vlib / v / checker / tests / match_option_without_none_err.out
7 lines · 7 sloc · 412 bytes · 1937cdd8419fe75a50a8c670ba01f0c1021ac7e2
Raw
1vlib/v/checker/tests/match_option_without_none_err.vv:16:3: error: `match` expression with Option type only checks against `none`, to match its value you must unwrap it first `var?`
2 14 | match p.part {
3 15 | // Next weird line crashes compiler before sugesting 'unwrap' var?
4 16 | none, 1 { return '' }
5 | ~~~~~~~
6 17 | else { return '${p.part}' }
7 18 | }
8