| 1 | fn f(x: u32) void { |
| 2 | const value: bool = switch (x) { |
| 3 | 1234 => false, |
| 4 | else => true, |
| 5 | else => true, |
| 6 | }; |
| 7 | } |
| 8 | fn g(x: error{ Foo, Bar, Baz }!u32) void { |
| 9 | const value: bool = if (x) |_| true else |e| switch (e) { |
| 10 | error.Foo => false, |
| 11 | else => true, |
| 12 | else => true, |
| 13 | }; |
| 14 | } |
| 15 | fn h(x: error{ Foo, Bar, Baz }!u32) void { |
| 16 | const value: u32 = x catch |e| switch (e) { |
| 17 | error.Foo => 1, |
| 18 | else => 2, |
| 19 | else => 3, |
| 20 | }; |
| 21 | } |
| 22 | export fn entry() void { |
| 23 | f(1234); |
| 24 | g(1234); |
| 25 | h(1234); |
| 26 | } |
| 27 | |
| 28 | // error |
| 29 | // |
| 30 | // :5:9: error: multiple else prongs in switch expression |
| 31 | // :4:9: note: previous else prong here |
| 32 | // :12:9: error: multiple else prongs in switch expression |
| 33 | // :11:9: note: previous else prong here |
| 34 | // :19:9: error: multiple else prongs in switch expression |
| 35 | // :18:9: note: previous else prong here |