The Any
here indicates a total failure of the return type inference:
julia> f(op::Op, a, b) where {Op} = op(a, b)
f (generic function with 1 method)
julia> Core.Compiler.return_type(f, Tuple{typeof(=>),Int,Int})
Any
Why does @inferred
not throw, then:
julia> using Test
julia> @inferred f(=>, 3, 7)
3 => 7