| ... | ... | @@ -22741,7 +22741,14 @@ fn zirPtrCastNoDest(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.Inst |
| 22741 | 22741 | var ptr_info = operand_ty.ptrInfo(mod); |
| 22742 | 22742 | if (flags.const_cast) ptr_info.flags.is_const = false; |
| 22743 | 22743 | if (flags.volatile_cast) ptr_info.flags.is_volatile = false; |
| 22744 | | const dest_ty = try sema.ptrType(ptr_info); |
| 22744 | |
| 22745 | const dest_ty = blk: { |
| 22746 | const dest_ty = try sema.ptrType(ptr_info); |
| 22747 | if (operand_ty.zigTypeTag(mod) == .Optional) { |
| 22748 | break :blk try mod.optionalType(dest_ty.toIntern()); |
| 22749 | } |
| 22750 | break :blk dest_ty; |
| 22751 | }; |
| 22745 | 22752 | |
| 22746 | 22753 | if (try sema.resolveValue(operand)) |operand_val| { |
| 22747 | 22754 | return Air.internedToRef((try mod.getCoerced(operand_val, dest_ty)).toIntern()); |