# Adding a fallback method for all functions/callables and specific argument types

**URL:** <https://discourse.julialang.org/t/adding-a-fallback-method-for-all-functions-callables-and-specific-argument-types/15115>\
**Category:** Internals & Design\
**Created:** [September 18, 2018, 9:55am UTC](https://discourse.julialang.org/t/adding-a-fallback-method-for-all-functions-callables-and-specific-argument-types/15115 "2018-09-18T09:55:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [September 18, 2018, 9:55am UTC](https://discourse.julialang.org/t/adding-a-fallback-method-for-all-functions-callables-and-specific-argument-types/15115/1 "2018-09-18T09:55:26Z")

</div>

Currently, this syntax is not supported:

```julia
julia> struct MyWrapperType{T}
           wrapped::T
       end

julia> (f::Any)(t::MyWrapperType) = f(t.wrapped)
ERROR: cannot add methods to an abstract type
Stacktrace:
 [1] top-level scope at none:0

julia> (f::F)(t::MyWrapperType) where {F} = f(t.wrapped)
ERROR: function type in method definition is not a type
Stacktrace:
 [1] top-level scope at none:0

```

Is that because it is not possible to support or can it be introduced in a future version?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 18, 2018, 9:59am UTC](https://discourse.julialang.org/t/adding-a-fallback-method-for-all-functions-callables-and-specific-argument-types/15115/2 "2018-09-18T09:59:37Z")

</div>

You can read up here [https://github.com/JuliaLang/julia/issues/14919](https://github.com/JuliaLang/julia/issues/14919). I think the conclusion is still pending on whether that can be done or not.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [September 18, 2018, 10:03am UTC](https://discourse.julialang.org/t/adding-a-fallback-method-for-all-functions-callables-and-specific-argument-types/15115/3 "2018-09-18T10:03:59Z")

</div>

I see thanks for the pointer.
