| author | |
| committer | |
| log | dbfeade22114d03c5f6dbf1f3f1d5946a10877a7 |
| tree | 530814d90c591b42c1f06f505b969180ebd24459 |
| parent | 2e99c3042e2641dda21768a898905784aa939031 |
| signature |
also fixes related test case and makes it run everywhere, not just on x86_64-linux!2 files changed, 2 insertions(+), 3 deletions(-)
src/Sema.zig+1-1| ... | ... | @@ -10590,7 +10590,7 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp |
| 10590 | 10590 | break :err_union_ty raw_operand_ty.childType(zcu); |
| 10591 | 10591 | }; |
| 10592 | 10592 | if (err_union_ty.zigTypeTag(zcu) != .error_union) { |
| 10593 | return sema.fail(block, src, "expected error union type, found '{f}'", .{ | |
| 10593 | return sema.fail(block, operand_src, "expected error union type, found '{f}'", .{ | |
| 10594 | 10594 | err_union_ty.fmt(pt), |
| 10595 | 10595 | }); |
| 10596 | 10596 | } |
test/cases/compile_errors/switch_on_non_err_union.zig+1-2| ... | ... | @@ -5,6 +5,5 @@ pub fn main() void { |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | // error |
| 8 | // target=x86_64-linux | |
| 9 | 8 | // |
| 10 | // :2:23: error: expected error union type, found 'bool' | |
| 9 | // :2:11: error: expected error union type, found 'bool' |