Someone who has touched a corpse – i.e. he has brought a part of his own body into contact with the corpse – can fast without performing the ghusl for touching a corpse (mass al‑mayyit). Furthermore, if one touches a corpse while fasting, his fast does not become invalid.