# VarArg Dispatch Issue / Possible Bug

**URL:** <https://discourse.julialang.org/t/vararg-dispatch-issue-possible-bug/42993>\
**Category:** General Usage\
**Created:** [July 13, 2020, 6:58pm UTC](https://discourse.julialang.org/t/vararg-dispatch-issue-possible-bug/42993 "2020-07-13T18:58:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [July 13, 2020, 6:58pm UTC](https://discourse.julialang.org/t/vararg-dispatch-issue-possible-bug/42993/1 "2020-07-13T18:58:18Z")

</div>

```julia
julia> typ = Vararg{Any,N} where N
Vararg{Any,N} where N

julia> f(x::UnionAll) = :A
f (generic function with 1 method)

julia> f(::Type{T}) where T = :B
f (generic function with 2 methods)

julia> f(other) = :C
f (generic function with 3 methods)

julia> f(typ)
:A

julia> f(typ.body)
ERROR: TypeError: in TypeVar, in upper bound, expected Type, got Vararg{Any,N} where N
Stacktrace:
 [1] top-level scope at REPL[6]:1

```

why VarArg is not able to dispatch? however if I fo f(::Type) = :B , it will work.

---

<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 14, 2020, 6:07am UTC](https://discourse.julialang.org/t/vararg-dispatch-issue-possible-bug/42993/2 "2020-07-14T06:07:58Z")

</div>

`Vararg` is not a type, it can be a type _parameter_ if it is the last one in a `Tuple`. See `?Vararg`.
