Consider this reduced example:
f(term, sets...) = (sets..., zero(term)), zero(term)
g(sets, term, terms...) = g(_g(sets, term), terms...)
g(sets) = sets
function _g(sets, term)
newsets, newset = f(term, sets...)
return newsets
end
function main(terms)
sets = g((), terms...)
return sets
end
using StaticArrays
ss = (SVector{2,Int}, SVector{1,Float64}, SVector{2,Int})
I want to ensure type-stability of a related (but more complicated) piece of code. But I see this (v1.0.2 and v1.1)
julia> @code_warntype main(ss)
Body::Tuple
....
while g((), ss...)
that is called by main
is inferred just fine!
julia> @code_warntype g((), ss...)
Body::Tuple{SArray{Tuple{2},Int64,1,2},SArray{Tuple{1},Float64,1,1},SArray{Tuple{2},Int64,1,2}}
...
Any help to make main
inferable would be very appreciated!