The following works as expected:
function f(
x::AbstractDict{KV,Tuple{Int}},
y::Union{Set{K},Dict{K,V}},
) where {K,V, KV <: Union{K,Tuple{K,V}}}
return "done"
end
K = Int
x = Dict{K,Tuple{Int}}()
y = Set{K}()
julia> f(x, y)
"done"
Now replace K = Int with K = Tuple{Int,Int} and now it throws MethodError: no method matching