| ... | ... | @@ -5282,12 +5282,10 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v |
| 5282 | 5282 | // %b = store(%a, %c) |
| 5283 | 5283 | // Where %c is an error union or error set. In such case we need to add |
| 5284 | 5284 | // to the current function's inferred error set, if any. |
| 5285 | | if (is_ret and (sema.typeOf(operand).zigTypeTag(mod) == .ErrorUnion or |
| 5286 | | sema.typeOf(operand).zigTypeTag(mod) == .ErrorSet) and |
| 5287 | | sema.fn_ret_ty.zigTypeTag(mod) == .ErrorUnion) |
| 5288 | | { |
| 5289 | | try sema.addToInferredErrorSet(operand); |
| 5290 | | } |
| 5285 | if (is_ret and sema.fn_ret_ty_ies != null) switch (sema.typeOf(operand).zigTypeTag(mod)) { |
| 5286 | .ErrorUnion, .ErrorSet => try sema.addToInferredErrorSet(operand), |
| 5287 | else => {}, |
| 5288 | }; |
| 5291 | 5289 | |
| 5292 | 5290 | const ptr_src: LazySrcLoc = .{ .node_offset_store_ptr = inst_data.src_node }; |
| 5293 | 5291 | const operand_src: LazySrcLoc = .{ .node_offset_store_operand = inst_data.src_node }; |