# Base.methods matches subtypes and supertypes

**URL:** <https://discourse.julialang.org/t/base-methods-matches-subtypes-and-supertypes/83525>\
**Category:** General Usage\
**Tags:** question, methods\
**Created:** [June 29, 2022, 4:21pm UTC](https://discourse.julialang.org/t/base-methods-matches-subtypes-and-supertypes/83525 "2022-06-29T16:21:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tictaccat](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Post date:** [June 29, 2022, 4:21pm UTC](https://discourse.julialang.org/t/base-methods-matches-subtypes-and-supertypes/83525/1 "2022-06-29T16:21:05Z")

</div>

`Base.methods` seems to return both subtypes and supertypes:

```julia
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.)
