# Method lookup: why does this not fail for zygote adjoint overload

**URL:** https://discourse.julialang.org/t/method-lookup-why-does-this-not-fail-for-zygote-adjoint-overload/132498
**Category:** New to Julia
**Created:** [September 18, 2025, 7:16pm UTC](https://discourse.julialang.org/t/method-lookup-why-does-this-not-fail-for-zygote-adjoint-overload/132498 "2025-09-18T19:16:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)
#### Post date: [September 18, 2025, 7:16pm UTC](https://discourse.julialang.org/t/method-lookup-why-does-this-not-fail-for-zygote-adjoint-overload/132498/1 "2025-09-18T19:16:03Z")

</div>

when a module foo does have Zygote to take AD, how come `@eval foo f'`not fail:

```julia
using Zygote
module foo
    f(x) = sin(x)
end

using .foo

@eval foo f'(1.2) - cos(1.2)

```

src code is at [Zygote.jl/src/compiler/interface.jl at e0af1a814b9c1b652861eda5db27ddec13a28d16 · FluxML/Zygote.jl · GitHub](https://github.com/FluxML/Zygote.jl/blob/e0af1a814b9c1b652861eda5db27ddec13a28d16/src/compiler/interface.jl#L158)

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [September 18, 2025, 7:54pm UTC](https://discourse.julialang.org/t/method-lookup-why-does-this-not-fail-for-zygote-adjoint-overload/132498/2 "2025-09-18T19:54:30Z")

</div>

I’m missing something. Do you expect it to fail? How?
