| ... | ... | @@ -16314,6 +16314,7 @@ static IrInstruction *ir_resolve_result_raw(IrAnalyze *ira, IrInstruction *suspe |
| 16314 | 16314 | IrInstruction *bitcasted_value; |
| 16315 | 16315 | if (value != nullptr) { |
| 16316 | 16316 | bitcasted_value = ir_analyze_bit_cast(ira, result_loc->source_instruction, value, dest_type); |
| 16317 | dest_type = bitcasted_value->value->type; |
| 16317 | 16318 | } else { |
| 16318 | 16319 | bitcasted_value = nullptr; |
| 16319 | 16320 | } |
| ... | ... | @@ -16378,11 +16379,13 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s |
| 16378 | 16379 | ir_assert(result_loc->value->type->id == ZigTypeIdPointer, suspend_source_instr); |
| 16379 | 16380 | ZigType *actual_elem_type = result_loc->value->type->data.pointer.child_type; |
| 16380 | 16381 | if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && |
| 16381 | | value_type->id != ZigTypeIdNull && value == nullptr) |
| 16382 | value_type->id != ZigTypeIdNull && type_has_bits(value_type)) |
| 16382 | 16383 | { |
| 16383 | 16384 | result_loc_pass1->written = false; |
| 16384 | 16385 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true); |
| 16385 | | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion && value == nullptr) { |
| 16386 | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion && |
| 16387 | type_has_bits(value_type)) |
| 16388 | { |
| 16386 | 16389 | if (value_type->id == ZigTypeIdErrorSet) { |
| 16387 | 16390 | return ir_analyze_unwrap_err_code(ira, suspend_source_instr, result_loc, true); |
| 16388 | 16391 | } else { |