| ... | @@ -11255,10 +11255,18 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp | ... | @@ -11255,10 +11255,18 @@ fn zirSwitchBlockErrUnion(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp |
| 11255 | defer seen_errors.deinit(); | 11255 | defer seen_errors.deinit(); |
| 11256 | | 11256 | |
| 11257 | const operand_ty = sema.typeOf(raw_operand_val); | 11257 | const operand_ty = sema.typeOf(raw_operand_val); |
| 11258 | const operand_err_set_ty = if (extra.data.bits.payload_is_ref) | 11258 | const operand_err_set = if (extra.data.bits.payload_is_ref) |
| 11259 | operand_ty.childType(mod).errorUnionSet(mod) | 11259 | operand_ty.childType(mod) |
| 11260 | else | 11260 | else |
| 11261 | operand_ty.errorUnionSet(mod); | 11261 | operand_ty; |
| | 11262 | |
| | 11263 | if (operand_err_set.zigTypeTag(mod) != .ErrorUnion) { |
| | 11264 | return sema.fail(block, switch_src, "expected error union type, found '{}'", .{ |
| | 11265 | operand_ty.fmt(mod), |
| | 11266 | }); |
| | 11267 | } |
| | 11268 | |
| | 11269 | const operand_err_set_ty = operand_err_set.errorUnionSet(mod); |
| 11262 | | 11270 | |
| 11263 | const block_inst: Air.Inst.Index = @enumFromInt(sema.air_instructions.len); | 11271 | const block_inst: Air.Inst.Index = @enumFromInt(sema.air_instructions.len); |
| 11264 | try sema.air_instructions.append(gpa, .{ | 11272 | try sema.air_instructions.append(gpa, .{ |