Zig errors when trying to reify a std.builtin.Type of variant Struct that has a non-empty decls field (to be expected, since std.builtin.Type.Declaration holds just a name, and no body). is there a workaround for that? can I somehow programmatically create a type, with fields of my choosing, and declarations with statically known names whose bodies I compute? or am I forced to do some ugly thing such as:
struct {
fields: MyComputedFields(...), // all field accesses will look like `name.fields.something` (rather then `name.something`), which is ugly.
const a = myComputedDeclA(...),
const b = myComputedDeclB(...),
const c = myComputedDeclC(...),
}
something like Go's struct embedding would be a way to solve this
and more generally: what's the reason reifed types can't have decls? and is the type inspection API subject to change? it currently looks to have many oddities, and some design decisions I feel are just wrong (though those could be because I don't understand some things...)