# Get ambiguous method candidates

**URL:** <https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953>\
**Category:** General Usage\
**Created:** [April 24, 2021, 8:41pm UTC](https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953 "2021-04-24T20:41:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 24, 2021, 8:41pm UTC](https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953/1 "2021-04-24T20:41:43Z")

</div>

```julia
struct Foo end
struct Bar end

f(x::Foo, y) = 2
f(x, y::Bar) = 3

f(Foo(), Bar()) # ambiguous

```

This errors because of ambiguity. How can I get the list of candidate functions? I’m not sure why

```julia
methods(f, (Foo, Bar))

```

returns empty.

---

<div class="post-metadata">

**Author:** ![mateuszbaran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mateuszbaran/32/221842_2.png) [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Post date:** [April 24, 2021, 9:17pm UTC](https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953/2 "2021-04-24T21:17:56Z")

</div>

This seems to work:

```julia
julia> Base.methods_including_ambiguous(f, Tuple{Foo, Bar})
# 2 methods for generic function "f":
[1] f(x::Foo, y) in Main at REPL[6]:1
[2] f(x, y::Bar) in Main at REPL[7]:1

```
