| 1 | pub export fn complex() void { |
| 2 | var a: error{ Foo, Bar } = error.Foo; |
| 3 | _ = &a; |
| 4 | switch (a) { |
| 5 | error.Foo => unreachable, |
| 6 | error.Bar => unreachable, |
| 7 | else => { |
| 8 | @compileError("<something complex here>"); |
| 9 | }, |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | pub export fn simple() void { |
| 14 | var a: error{ Foo, Bar } = error.Foo; |
| 15 | _ = &a; |
| 16 | switch (a) { |
| 17 | error.Foo => unreachable, |
| 18 | error.Bar => unreachable, |
| 19 | else => |e| return e, |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | // error |
| 24 | // |
| 25 | // :7:14: error: unreachable else prong; all cases already handled |