typing: warn about useless null when the target is always `null`