# Possible bug with tuple values in type arguments

**URL:** <https://discourse.julialang.org/t/possible-bug-with-tuple-values-in-type-arguments/71750>\
**Category:** General Usage\
**Tags:** question, bug\
**Created:** [November 18, 2021, 10:33pm UTC](https://discourse.julialang.org/t/possible-bug-with-tuple-values-in-type-arguments/71750 "2021-11-18T22:33:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgroenks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgroenks/32/21784_2.png) [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Post date:** [November 18, 2021, 10:33pm UTC](https://discourse.julialang.org/t/possible-bug-with-tuple-values-in-type-arguments/71750/1 "2021-11-18T22:33:22Z")

</div>

Hi all,

Can anyone explain why the following works:

```julia
Val{(:a,:b,:c)}()

```

but this does not?

```julia
Val{(:a,:b,(:c,:d))}()

```

```julia
ERROR: TypeError: in Type, in parameter, expected Type, got a value of type Tuple{Symbol, Symbol, Tuple{Symbol, Symbol}}
Stacktrace:
 [1] top-level scope
   @ REPL[77]:1

```

At first, I thought maybe the problem was the nested tuple, but this works fine:

```julia
Val{(:a,:b,(1,2))}()

```

So what’s up with this? I don’t really see the logical reason why sometimes tuple values are allowed in type arguments, and sometimes they are not?

`ComponentArrays` also seems to somehow get away with this, since all of the axis information is stored as named tuples in `Axis`. Maybe @jonniedie could provide some insight here?

---

<div class="post-metadata">

**Author:** ![jonniedie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jonniedie/32/12842_2.png) [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Post date:** [November 18, 2021, 10:46pm UTC](https://discourse.julialang.org/t/possible-bug-with-tuple-values-in-type-arguments/71750/2 "2021-11-18T22:46:20Z")

</div>

Oh, that’s weird. I don’t have a good explanation for that. ComponentArrays actually stores other `AbstractAxis` instances inside the `Axis` type parameters. So it’s more similar to

```julia
Val{(:a,:b,Val{(:c,:d)}())}()

```

(which works)

---

<div class="post-metadata">

**Author:** ![bgroenks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgroenks/32/21784_2.png) [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Post date:** [November 19, 2021, 9:39am UTC](https://discourse.julialang.org/t/possible-bug-with-tuple-values-in-type-arguments/71750/3 "2021-11-19T09:39:46Z")

</div>

Yes, that works for me too. The only difference is the nested `Val`. Still, I’m not seeing the logic behind why one is allowed by the type system but not the other. I think we need a Julia type expert here.
