comparison test/test_util.jl @ 760:e7176fb09e98 test/type_stability

Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 02 Jul 2021 14:02:45 +0200
parents
children
comparison
equal deleted inserted replaced
759:80d88bb1c5bd 760:e7176fb09e98
1 function is_type_stable(f,args...)
2 type_stable = true
3 try @inferred f(args...)
4 catch
5 type_stable = false
6 end
7 return type_stable
8 end