Arithmetic on integer type parameters


#1

I’m trying to do something along the likes of

struct Simplex{d}
  vindices::NTuple{d+1,Int}
end

I know of the workaround in this answer but is there some other solution that doesn’t involve changing my type signature?
If not, would this be a reasonable feature request? By declaring d<:Int I feel like the compiler shouldn’t have a problem figuring out simple arithmetic.


Save memory of a translational symmetric matrix
#2

No, it’s sort of d::Int but certainly not d<:Int.

No.

Not directly but kind of. This is https://github.com/JuliaLang/julia/issues/18466


#3

Yes d::Int of course. Thanks for pointing me to the ticket.
There I found the solution (at least for my specific usecase):

struct Simplex{d}
  vindices::Tuple{Int,Vararg{Int,d}}
end