# Rules for method dispatch with keyword arguments

**URL:** <https://discourse.julialang.org/t/rules-for-method-dispatch-with-keyword-arguments/23626>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [April 28, 2019, 7:43pm UTC](https://discourse.julialang.org/t/rules-for-method-dispatch-with-keyword-arguments/23626 "2019-04-28T19:43:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [April 28, 2019, 9:00pm UTC](https://discourse.julialang.org/t/rules-for-method-dispatch-with-keyword-arguments/23626/3 "2019-04-28T21:00:19Z")

</div>

If I type it to `Int` then the method is overwritten. But the point is that the second method should have a different signature in the positional parameter space. I chose `Any` but equally well I could have written e.g.:

```julia
f(x::Integer; kwarg) = "integer"

```

and the same problem would arise.

For a reference: this is not an artificial question but in DataFrames.jl we actually have methods which for “wider” (something like catch-all) method signature take keyword arguments but for narrower signatures did not take keyword arguments (because they were not needed). I initially expected that passing a keyword argument with a more specific type would throw an error (because the narrower function did not accept keyword arguments) - and this would be in line with what the documentation currently says.

---

_[View the full topic](https://discourse.julialang.org/t/rules-for-method-dispatch-with-keyword-arguments/23626)._
