Downcasts are expensive and explicitly listing all TypeInfos that define getHash might easily break.
Even though it's slow too, I'd suggest to use TypeInfo.getHash for each element.