# @which and applicable report uncallable method

**URL:** <https://discourse.julialang.org/t/which-and-applicable-report-uncallable-method/12108>\
**Category:** General Usage\
**Created:** [July 2, 2018, 8:51pm UTC](https://discourse.julialang.org/t/which-and-applicable-report-uncallable-method/12108 "2018-07-02T20:51:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [July 2, 2018, 8:51pm UTC](https://discourse.julialang.org/t/which-and-applicable-report-uncallable-method/12108/1 "2018-07-02T20:51:45Z")

</div>

Am I correct in thinking this is a bug in Julia ?

```julia
julia> applicable(iterate,Int)
true

julia> iterate(Int)
ERROR: MethodError: no method matching iterate(::Type{Int64})
Closest candidates are:
  iterate(::Any) at essentials.jl:821

julia> @which iterate(Int)
iterate(x) in Base at essentials.jl:821

```

The same happens with other types, such as `Regex`.

I am using

```julia
Version 0.7.0-beta.99
Commit 0a77e89cd5 (2 days old master)

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [July 2, 2018, 8:55pm UTC](https://discourse.julialang.org/t/which-and-applicable-report-uncallable-method/12108/2 "2018-07-02T20:55:06Z")

</div>

There’s a fallback definition for compatibility with the old iteration protocol that defines a generic `iterate` method. If it then finds neither the old nor the new iteration protocol, it throws an `iterate` method error of the kind that you should define. If you want to find out whether there’s a non fallback definition available, you can use `Base.isiterable`, which filters out the fallback definition.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [July 2, 2018, 9:42pm UTC](https://discourse.julialang.org/t/which-and-applicable-report-uncallable-method/12108/3 "2018-07-02T21:42:38Z")

</div>

I think this will work for me. I was unable to find the information elsewhere.

Btw. This came up because I want to call a function recursively on anything I can `map` over. In v0.6.x I had been using `applicable(start, x)` as a proxy for `applicable(map, identity, x)`. In `v0.7-beta`, the latter also returns `true` for cases in which `map(identity, x)` throws an error, because it ultimately calls `iterate`.
