While experimenting with some performance bottlenecks, I found that
h1(n) = ntuple(i -> collect(0:1/n:1), 3) @code_warntype h1(5)
show type instability (it cannot infer 3 as the length of the tuple), while
f(n) = ntuple(i -> n, 3) g(n) = collect(0:1/n:1) h2(n) = f(g(n)) @code_warntype h2(5)
seems to be fine.
I feel like this is non-expected behaviour and if possible I’d like
h1 to be type stable without the need to split it up like that. Is this a known issue or am I just doing things the wrong way?