Previously, the dispatch to subclasses was unchecked, resulting in
tryGetValues<int32_t> on a DenseF32ArrayAttr asserting instead of
resulting failure(). This changes the implementation of
getValuesImpl to do dynamic dispatch to the subclasses, failing where
appropriate.
Depends on D132758