The type cannot be inferred because the container has element type Any. So it will have to be a runtime check, which (I suspect) you have to write yourself.
Brilliant! Why didn’t I think of trying a splat? Thanks!!
It’s a small part of a large optimization model (using JuMP). I have a macro that reads an external table of variable names and data and creates those variables in the local scope. And now I wanted to identify the type as well.
I know this setup would be absolutely horrible for ordinary coding projects, but for optimization the focus is on the equations, so the hack is fine. Probably.