Type instability with (fairly) simple Tuples

I think the problem is that using comprehension syntax lowers to Base.Generator which doesn’t have the length in the type. So you’d need the length to be constant-propagated by the compiler, which I guess it isn’t.

Anyway the answer here is to use map(x->x[1], t) or ntuple(i->t[i][1], length(t)). These should be type stable.

1 Like