julia> begin
f(x::Int) = 1
f(x::Bool) = 2
applyf(container::AbstractVector) = f(container[1])
callapplyf(container) = applyf(container)
end
callapplyf (generic function with 1 method)
julia> callapplyf(Any[1])
1
julia> mi = only(Base.specializations(only(methods(applyf))))
MethodInstance for applyf(::Vector{Any})
julia> mi.backedges
3-element Vector{Any}:
MethodInstance for callapplyf(::Vector{Any})
Tuple{typeof(applyf), AbstractVector}
MethodInstance for callapplyf(::Vector{Any})
That last pair,
Tuple{typeof(applyf), AbstractVector}
MethodInstance for callapplyf(::Vector{Any})
is the kind of backedge you'd get if callapplyf were implemented as
callapplyf(container) = invoke(applyf, Tuple{AbstractVector}, container)
The fact that it's here seems to be a bug.
That last pair,
Tuple{typeof(applyf), AbstractVector} MethodInstance for callapplyf(::Vector{Any})is the kind of backedge you'd get if
callapplyfwere implemented asThe fact that it's here seems to be a bug.