Dispatch on type only

I believe Type{T} is what you’re looking for:

julia> choose(t::Type{Float64}) = println("choosing t::Float64")
choose (generic function with 1 method)

julia> choose(t::Type{Tuple}) = println("choosing t::Tuple")
choose (generic function with 2 methods)

julia> choose(Float64)
choosing t::Float64

julia> choose(Tuple)
choosing t::Tuple
8 Likes