Different behaviors between SVector and SMatrix parametric types

Because that’s how SVector is defined

const SVector{S,T} = SArray{Tuple{S}, T, 1, S}

Whereas SMatrix requires all 4 type parameters:

const SMatrix{S1, S2, T, L} = SArray{Tuple{S1, S2}, T, 2, L}

The crucial difference is that L == S1 * S2 is not something the compiler can infer/calculate in type parameter space.

3 Likes