Worth adding the case that catches people out, since you asked about cheese: the hard-cheese rule does not transfer to shredded hard cheese.
It is the same cheese, but shredding turns one dense block into an enormous surface area with air between every piece, so it behaves like the soft category. If a bag of grated cheese has mould in it, the block rule does not apply to it. Same food, different structure, different answer - which is your original question in miniature.