I think the preferred way is to mix in the hash of the type itself, e.g. hash(a.t, hash(A, h)). But if you have code that relies on the hash being different then you are likely to have a bug since hash collisions are possible.
5 Likes