How to check what method is used by dispatch?

Hopefully there are better ways to do this, but one option is to use which and check the (internal, private, unreliable, use at your own risk) field sig:

julia> using Test, InteractiveUtils

julia> abstract type A end

julia> struct B<:A end

julia> struct C<:A end

julia> should_return_one(::A) = 1
should_return_one (generic function with 2 methods)

julia> should_return_one(x::B) = 2
should_return_one (generic function with 2 methods)

julia> which(should_return_one, (B,)).sig
Tuple{typeof(should_return_one), B}

julia> which(should_return_one, (C,)).sig
Tuple{typeof(should_return_one), A}