"Negative Type Check"

// Revive the player if they're not a monster
if (player is not MonsterPlayer) player.Revive();

// Send the player to hell if they're not a hero, otherwise send them to heaven
if (player is not HeroPlayer hero) player.SendToHell();
else hero.SendToHeaven();


Code snippet taken from "Two Decades of C#: A Reference - C# 9".