# Why \`Tuple{Vararg{T, 2} where T} == Tuple{Any, Any}\`?

**URL:** https://discourse.julialang.org/t/why-tuple-vararg-t-2-where-t-tuple-any-any/33511
**Category:** General Usage
**Created:** [January 18, 2020, 5:16am UTC](https://discourse.julialang.org/t/why-tuple-vararg-t-2-where-t-tuple-any-any/33511 "2020-01-18T05:16:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Wenjie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wenjie/32/10123_2.png) [@Wenjie](https://discourse.julialang.org/u/Wenjie)
#### Post date: [January 18, 2020, 5:16am UTC](https://discourse.julialang.org/t/why-tuple-vararg-t-2-where-t-tuple-any-any/33511/1 "2020-01-18T05:16:05Z")

</div>

Why this is the case, instead of being a `UnionAll` like Arrays?

---

<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: [January 18, 2020, 10:08am UTC](https://discourse.julialang.org/t/why-tuple-vararg-t-2-where-t-tuple-any-any/33511/2 "2020-01-18T10:08:30Z")

</div>

Tuples are covariant as opposed to all other parametric types that are invariant.  
The reason for this is that tuples are used in signature matching in method dispatch, see [https://docs.julialang.org/en/latest/manual/types/#Tuple-Types-1](https://docs.julialang.org/en/latest/manual/types/#Tuple-Types-1).

Here is an example of this distinction:

```julia
julia> Tuple{Int} <: Tuple{Any}
true

julia> Vector{Int} <: Vector{Any}
false

julia> Vector{Int} <: Vector{<:Any}
true

```

You might also check out an answer on [StackOverflow](https://stackoverflow.com/questions/59798109/why-union-type-not-accepting-one-of-its-types-in-julia) that I have just written on a related topic.

---

<div class="post-metadata">

### Author: ![Wenjie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wenjie/32/10123_2.png) [@Wenjie](https://discourse.julialang.org/u/Wenjie)
#### Post date: [January 21, 2020, 1:39am UTC](https://discourse.julialang.org/t/why-tuple-vararg-t-2-where-t-tuple-any-any/33511/3 "2020-01-21T01:39:20Z")

</div>

I was thinking in the same direction too. I managed to convince myself after testing:

```julia
Union{Tuple{Int}, {Tuple{Any}} == Tuple{Any}

```
