# Methods seem to match but don't

**URL:** <https://discourse.julialang.org/t/methods-seem-to-match-but-dont/30429>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 29, 2019, 4:05am UTC](https://discourse.julialang.org/t/methods-seem-to-match-but-dont/30429 "2019-10-29T04:05:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alacritas](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@alacritas](https://discourse.julialang.org/u/alacritas)\
**Post date:** [October 29, 2019, 4:05am UTC](https://discourse.julialang.org/t/methods-seem-to-match-but-dont/30429/1 "2019-10-29T04:05:18Z")

</div>

I’m trying to call a function I’ve defined with only on method but will not call although I’m pretty sure all of my types are matching up

```nohighlight
a=[1,2,3]
b=[3,2,1]
function foo(a::Array{Float64,1}, b::Array{Float64,1}, c)
   #definition
end
foo(a,b,0.1)

```

The first two arguments match but not the last one.

---

<div class="post-metadata">

**Author:** ![Adriel](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adriel](https://discourse.julialang.org/u/Adriel)\
**Post date:** [October 29, 2019, 4:23am UTC](https://discourse.julialang.org/t/methods-seem-to-match-but-dont/30429/2 "2019-10-29T04:23:36Z")

</div>

They are arrays of `Int`s. Define your method as

```julia
function foo(a::AbstractVector, b::AbstractVector, c)
   #definition
end

```

or just

```julia
function foo(a, b, c)
   #definition
end

```

You won’t lose any performance and things will just work.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 29, 2019, 6:36am UTC](https://discourse.julialang.org/t/methods-seem-to-match-but-dont/30429/3 "2019-10-29T06:36:00Z")

</div>

Or use a parametric method

```julia
a=[1,2,3]
b=[3,2,1]
function foo(a::Array{T,1}, b::Array{T,1}, c) where {T}
   #definition
end
foo(a,b,0.1)

```
