How to write a unit test that checks whether a function is type stable

Note that Test.@inferred only tests the inference of the function output.
If you need to test full type inferrability, use JET.@test_opt from JET.jl

4 Likes