Dispatch on NamedTuple

Sure, the type of the ordinary tuple is part of the type of the named tuple:

julia> typeof((a=1, b=2))
NamedTuple{(:a, :b),Tuple{Int64,Int64}}

julia> ans <: NamedTuple{<:Any, <:Tuple{Vararg{Int}}}
true

julia> (a=1, b=2, c=3) isa NamedTuple{<:Any, <:Tuple{Vararg{Int}}}
true
4 Likes