mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Sema: use the correct integer
Sure would be nice if these two incompatible indexes had distinct types.
This commit is contained in:
parent
a415fe0bc0
commit
5515b81f8c
@ -7184,8 +7184,9 @@ fn zirSwitchCapture(
|
||||
|
||||
return sema.bitCast(block, else_error_ty, operand, operand_src);
|
||||
} else {
|
||||
const item_ref = sema.resolveInst(items[0]);
|
||||
// Previous switch validation ensured this will succeed
|
||||
const item_val = sema.resolveConstValue(block, .unneeded, items[0]) catch unreachable;
|
||||
const item_val = sema.resolveConstValue(block, .unneeded, item_ref) catch unreachable;
|
||||
|
||||
const item_ty = try Type.Tag.error_set_single.create(sema.arena, item_val.getError().?);
|
||||
return sema.bitCast(block, item_ty, operand, operand_src);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user