One approach could be to add another parameter.
mutable struct my_struct{N, T <: AbstractFloat, L}
a::MVector{N, T}
b::MMatrix{N, N, T, L}
end
my_struct(@MVector([1.0,2]), @MMatrix( [1.0 2; 2 3]))
This works since the parameter L can be determined at construction: API · StaticArrays.jl