This may be a research project to fix.
checklooptypes seems to not find any issues with the following code that uses 0 where it should use zero(T).
julia> function tally{T}( a::Vector{T} )
s = 0
for x in a
s += x
end
s
end
tally (generic function with 1 method)
julia> checklooptypes(tally)
TypeCheck.LoopResults(:tally,TypeCheck.LoopResult[])
Of course the type instability shows up only for certain instances of T. Maybe the module checker could check all instantiations used in the module?
This may be a research project to fix.
checklooptypesseems to not find any issues with the following code that uses 0 where it should usezero(T).Of course the type instability shows up only for certain instances of
T. Maybe the module checker could check all instantiations used in the module?