How to extract type parameters that are used as upper bounds in `UnionAll`?

I don’t think this is possible to achieve in a supported way. Some previous discussion:

AFAIK, in Julia’s dispatch logic, a method static parameter must be uniquely determined, with it’s lower bound equal to its upper bound, to be defined in the method body. So “extracting an upper bound” seems like something that would require additional language features.

2 Likes