# Type problem

**URL:** <https://discourse.julialang.org/t/type-problem/43421>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 21, 2020, 9:16am UTC](https://discourse.julialang.org/t/type-problem/43421 "2020-07-21T09:16:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![janrpeters](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@janrpeters](https://discourse.julialang.org/u/janrpeters)\
**Post date:** [July 21, 2020, 9:16am UTC](https://discourse.julialang.org/t/type-problem/43421/1 "2020-07-21T09:16:27Z")

</div>

I have the method

```julia
plotCDFComparison(p::Union{Type{Gumbel}, Type{Laplace}, Type{Logistic}, Type{Normal}})
    ...
end

```

but when I run it as

```julia
plotCDFComparison(Normal(μ,σ));

```

I get an error

```julia
MethodError: no method matching plotCDFComparison(::Normal{Float64})
Closest candidates are:
  plotCDFComparison(!Matched::Union{Type{Gumbel}, Type{Laplace}, Type{Logistic}, Type{Normal}}) at In[8]:2

```

Does any of you understand why it does not get this right? It must have to do with the Float64 but I don’t get how to fix it!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 21, 2020, 10:25am UTC](https://discourse.julialang.org/t/type-problem/43421/2 "2020-07-21T10:25:44Z")

</div>

You are dispatching on types as values above. You are probably looking for `p::Union{Normal,...}` but it is hard to say without a self-contained example.
