Improve shape inference in `cat` (#37080)
`cat` is frequently called with poor inference, since one only has
to concatenate a couple of different container types before inference
punts on the result type. While this does not make the return type
in mixed container types fully inferrable, it does improve the analysis
of the shape.