Sometimes I wish I could express that the parameters of a certain parametrised struct must be of a certain type. For example, I would like to have syntax that allows
struct ContinuousShift{s::Real} <: AbstractSymmetry end
to mean that the parameter s will be a real number, or maybe
struct DiscreteShift{m::Int} <: AbstractSymmetry end
for when only integers would make sense. I can live without this, but I think other people might have wanted this kind of ability at some point.
FWIW, I think if this were to be implemented, I think
struct DiscreteShift{m isa Int} <: AbstractSymmetry end
would be more consistent than
struct DiscreteShift{m::Int} <: AbstractSymmetry end
because outside of type definitions m<:Foo returns a boolean, whereas m::Int is a type assertion, as noted in @yuyichao’s comment, and m isa Int would also return a boolean.