Parameterize by Value with Union

You could wrap the values in Val to lift them to the type domain. Then you could do:

struct Mesh{D<:Union{Val{1},Val{2},Val{3}}}
...
end