| ... | ... | @@ -7184,8 +7184,9 @@ fn zirSwitchCapture( |
| 7184 | 7184 | |
| 7185 | 7185 | return sema.bitCast(block, else_error_ty, operand, operand_src); |
| 7186 | 7186 | } else { |
| 7187 | const item_ref = sema.resolveInst(items[0]); |
| 7187 | 7188 | // 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; |
| 7189 | 7190 | |
| 7190 | 7191 | const item_ty = try Type.Tag.error_set_single.create(sema.arena, item_val.getError().?); |
| 7191 | 7192 | return sema.bitCast(block, item_ty, operand, operand_src); |