A pointer seen as pointing at another type: ptr.cast[T]['p'] keeps the address and whether it may write, and changes only what it claims to point at.
ptr_cast.zg
# A pointer seen as pointing at another type (owner, 2026-09-30: a): `ptr.cast[T]['p']` keeps the# address and whether it may write, and changes only what it claims to point at. Always no_check.extern.Cfnmalloc['bytes':uint64]->ptr.mut[uint8];extern.Cfnfree['p':ptr.mut[uint8]];layout.CstructPoint{x:int32,y:int32}MAIN{no_checklet'raw':=malloc[size.of[Point]];no_checklet'p':=ptr.cast[Point]['raw'];no_checkptr.write['p',valuePoint[x=3,y=4]];no_checklet'q':=ptr.read['p'];std::print.stored['q'.x," ",'q'.y,newln];no_checkfree['raw'];}