When I was working with Julia I wanted it to just throw an error whenever a top level program was compiled to unstable types. I didn’t find a way to do it though :(
It recently got support on vscode.
What was available in Julia before (things like @code_typed) are only applicable locally, so there is only limited benefit. Because linters have dramatically improved in recent years, it feels like Julia was lagging behind until recently.
Actually thinking about it, Julia could use something like refinement types ala Liquidhaskell: http://ucsd-progsys.github.io/liquidhaskell-tutorial/Tutoria...
Test.@inferred is not quite what is needed:
function foo(x)
s = 0
# better use a zero of the same type than x
# s = zero(x)
for y in x
s += y
end
return s
end
Test.@inferred Float64 foo(12.1)
This test succeeds even if code is type-unstable