Base.methods
seems to return both subtypes and supertypes:
julia> f(x::Integer) = 3
f (generic function with 1 method)
julia> methods(f, (Number,))
# 1 method for generic function "f":
[1] f(x::Integer) in Main at REPL[1]:1
julia> methods(f, (Int64,))
# 1 method for generic function "f":
[1] f(x::Integer) in Main at REPL[1]:1
What rule is it using? How can I make it only return one? In particular, I want only subtypes. (In fact, for my use case I want to check the precise signature with concrete types, if that makes it easier.)