Force calling the generic for benchmarking

You can use the invoke function for this, i.e.,

invoke(f, Tuple{Any}, 1)

will call the generic f(::Any) method with the argument 1. In Julia 1.7 you will be able to use the simpler syntax Base.@invoke f(1::Any).

5 Likes