authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-03-28 12:44:24+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-28 13:05:21-07:00
log5515b81f8c4f1b7eae98ee7bb41e4b4579de45dc
tree75186e8e5fcd0f575fc0e4e3f1566283070e9b89
parenta415fe0bc083159cf4bca6984636a564589e9789

Sema: use the correct integer

Sure would be nice if these two incompatible indexes had distinct types.

1 files changed, 2 insertions(+), 1 deletions(-)

src/Sema.zig+2-1
...@@ -7184,8 +7184,9 @@ fn zirSwitchCapture(...@@ -7184,8 +7184,9 @@ fn zirSwitchCapture(
71847184
7185 return sema.bitCast(block, else_error_ty, operand, operand_src);7185 return sema.bitCast(block, else_error_ty, operand, operand_src);
7186 } else {7186 } else {
7187 const item_ref = sema.resolveInst(items[0]);
7187 // Previous switch validation ensured this will succeed7188 // Previous switch validation ensured this will succeed
7188 const item_val = sema.resolveConstValue(block, .unneeded, items[0]) catch unreachable;7189 const item_val = sema.resolveConstValue(block, .unneeded, item_ref) catch unreachable;
71897190
7190 const item_ty = try Type.Tag.error_set_single.create(sema.arena, item_val.getError().?);7191 const item_ty = try Type.Tag.error_set_single.create(sema.arena, item_val.getError().?);
7191 return sema.bitCast(block, item_ty, operand, operand_src);7192 return sema.bitCast(block, item_ty, operand, operand_src);