# Problem with type mismatch -- MethodError: no method matching

**URL:** https://discourse.julialang.org/t/problem-with-type-mismatch-methoderror-no-method-matching/20725
**Category:** New to Julia
**Created:** [February 12, 2019, 9:33pm UTC](https://discourse.julialang.org/t/problem-with-type-mismatch-methoderror-no-method-matching/20725 "2019-02-12T21:33:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [February 12, 2019, 10:03pm UTC](https://discourse.julialang.org/t/problem-with-type-mismatch-methoderror-no-method-matching/20725/2 "2019-02-12T22:03:49Z")

</div>

When you declare a function with keyword arguments like this:

```julia-auto
function foo(x; y = 10)
end

```

then you _must_ provide the keywords when you call the function:

```julia-auto
foo(1, y = 2) # NOT: foo(1, 2)

```

By the way, it will be easier to read your code (and help you) if you format it correctly with backticks:

> [@PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530):
>
> This is a short post on how to use backticks (` and ```) to quote code, so it is easy to read. This post can be linked to new users who are confused by this feature. Why By quoting your code, you get a monospaced font (which preserves indentation) and syntax highlighting. This makes it easier to read your code and help you. Displayed code looks like this: function displayed\_code(x::Int, y::Int) if x \< y println("x is smaller") else println("or not") end end Inline…

---

_[View the full topic](https://discourse.julialang.org/t/problem-with-type-mismatch-methoderror-no-method-matching/20725)._
