Concretely specify the type of dims in SubArray

This allows the type of `size(S::SubArray)` to be inferred.

Submitting as a PR because I can't test on current master, due to #5576 acting weirdly on my machine (and on Travis) compared to everyone else who tested this.