Understanding Varargs partial specialization

In the “Be aware of when Julia avoids specializing”, section, the following is stated:

As a heuristic, Julia avoids automatically specializing on argument type parameters in three specific cases: Type , Function , and Vararg . Julia will always specialize when the argument is used within the method, but not if the argument is just passed through to another function.

This will not specialize:

f_vararg(x::Int...) = tuple(x...)

But when I check an untyped version, it looks like it’s specializing by the first element of the Vararg and possibly by the rest of the elements if homogenously typed. I say possibly because rerunning this with the nonhomogeneous calls first does not result in the homoegenous-Vararg MethodInstances (thus only 2 in total). I had expected from the docs that only f(::Vararg{Any}) would’ve been compiled, so what’s really going on here?

julia> using MethodAnalysis
julia> f(x...) = tuple(x...)
f (generic function with 1 method)
julia> f(1,1,1)
(1, 1, 1)
julia> f(1.0,1.0,1.0)
(1.0, 1.0, 1.0)
julia> f(1,1.0,1)
(1, 1.0, 1)
julia> f(1.0,1,1.0)
(1.0, 1, 1.0)
julia> methodinstances(f)
4-element Vector{Core.MethodInstance}:
 MethodInstance for f(::Float64, ::Vararg{Any})
 MethodInstance for f(::Int64, ::Vararg{Any})
 MethodInstance for f(::Float64, ::Vararg{Float64})
 MethodInstance for f(::Int64, ::Vararg{Int64})

I wonder if this might be related: