I just wanted to put together a demo app that lists these by name and color, but I’m struggling to get the reflection right. I’ve used something like this before (but with inline for), but today I’m getting a strange error on the si. of access of union field 'struct' while field 'type' is active.
So my understanding of .zig files being structs seems wrong. Is there a way to do this please, without moving all the constants into their own struct? Thanks.
Just a quick note - if you ever use this for iterating over @cImport()you might need to use inline for with if (comptime xxx) {}wrap because the translated code/struct often includes some @compileError calls.