# Can I 'force' a specific method to be called?

**URL:** <https://discourse.julialang.org/t/can-i-force-a-specific-method-to-be-called/59800>\
**Category:** New to Julia\
**Created:** [April 22, 2021, 12:25pm UTC](https://discourse.julialang.org/t/can-i-force-a-specific-method-to-be-called/59800 "2021-04-22T12:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefkuypers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefkuypers/32/19185_2.png) [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Post date:** [April 22, 2021, 12:25pm UTC](https://discourse.julialang.org/t/can-i-force-a-specific-method-to-be-called/59800/1 "2021-04-22T12:25:46Z")

</div>

Hi,

Consider the following:

```julia
abstract type FooBase end

bar(f::FooBase) = 1

struct Foo <: FooBase
counter::Integer
end

function bar(f::Foo)
f.counter += bar(f) # I want to call bar(f::FooBase) here
end

```

Can I somehow tell Julia that I want to call the first method instead of the more specific second method?

Thanks in advance,  
Stef

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [April 22, 2021, 12:28pm UTC](https://discourse.julialang.org/t/can-i-force-a-specific-method-to-be-called/59800/2 "2021-04-22T12:28:36Z")

</div>

Yes, you want ot use [`invoke`](https://docs.julialang.org/en/v1/base/base/#Core.invoke)
