| 1 | fn foo(i int) ?bool { |
| 2 | return match true { |
| 3 | i == 0 { true } |
| 4 | else { none } |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | fn bar(i int) !bool { |
| 9 | return match true { |
| 10 | i == 0 { true } |
| 11 | else { error('') } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | fn test_match_expr_with_result() { |
| 16 | r1 := foo(0) or { false } |
| 17 | println(r1) |
| 18 | assert r1 |
| 19 | |
| 20 | r2 := bar(0) or { false } |
| 21 | println(r2) |
| 22 | assert r2 |
| 23 | } |
| 24 |