| 1 | export fn a() void { |
| 2 | const x: error{}!void = {}; |
| 3 | x catch |_| { |
| 4 | @"_"; |
| 5 | }; |
| 6 | } |
| 7 | export fn b() void { |
| 8 | const x: error{}!void = {}; |
| 9 | x catch |_| switch (_) {}; |
| 10 | } |
| 11 | export fn c() void { |
| 12 | const x: error{}!u32 = 0; |
| 13 | if (x) |v| v else |_| switch (_) {} |
| 14 | } |
| 15 | |
| 16 | // error |
| 17 | // |
| 18 | // :3:14: error: discard of error capture; omit it instead |
| 19 | // :4:9: error: use of undeclared identifier '_' |
| 20 | // :9:14: error: discard of error capture; omit it instead |
| 21 | // :13:24: error: discard of error capture; omit it instead |