Possible bug with tuple values in type arguments

Hi all,

Can anyone explain why the following works:


but this does not?

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

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


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?

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


(which works)

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.