| 1 | export fn foo() void { |
| 2 | defer bar(); |
| 3 | } |
| 4 | fn bar() anyerror!i32 { |
| 5 | return 0; |
| 6 | } |
| 7 | |
| 8 | export fn foo2() void { |
| 9 | defer bar2(); |
| 10 | } |
| 11 | fn bar2() anyerror { |
| 12 | return error.a; |
| 13 | } |
| 14 | |
| 15 | // error |
| 16 | // |
| 17 | // :2:14: error: error union of type 'anyerror!i32' is ignored |
| 18 | // :2:14: note: consider using 'try', 'catch', or 'if' |
| 19 | // :9:15: error: error set of type 'anyerror' is ignored |