julia> using StaticArrays
julia> m = rand(SMatrix{3,3,Float64});
julia> f(m::SMatrix{N,N,T}) where {N,T} = SMatrix{N,N,T,N*N}(m[c] for c in CartesianIndices(m))
f (generic function with 1 method)
julia> f(m) # fine
3×3 SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
0.256642 0.842059 0.421776
0.408755 0.266084 0.887893
0.0570036 0.402704 0.260989
julia> @btime f($m)
ERROR: MethodError: objects of type SVector{2, Float64} are not callable
Use square brackets [] for indexing an Array.