| 1 | fn foo() !int { |
| 2 | return 0 |
| 3 | } |
| 4 | |
| 5 | fn test_main() { |
| 6 | mut x := 1 |
| 7 | // vfmt off |
| 8 | x = foo() or { panic("failed"); } |
| 9 | // vfmt on |
| 10 | println('x=${x}') |
| 11 | } |
| 12 | |
| 13 | fn return_zero_with_trailing_semicolon() int { |
| 14 | // vfmt off |
| 15 | return 0; |
| 16 | // vfmt on |
| 17 | } |
| 18 | |
| 19 | fn test_return_with_trailing_semicolon() { |
| 20 | assert return_zero_with_trailing_semicolon() == 0 |
| 21 | } |
| 22 |