Now that @Type has been replaced, what is the ideal way to generate a struct that also includes member functions?
You couldn’t do that through @Type either (the compiler would assert delcs was empty), it is an intentional limitation.
That was one of motivations for the individual builtins, so they could remove fields that you were already not allowed to use.
But can’t you create a struct manually that has member functions just by returning struct { pub fn memberFunction() void {} } from a comptime function? What’s the point of not allowing that programmatically?
Correct, and that is one of the reasons not to be able to reify declarations, this way is simpler and easier to read.
andrews response to an issue asking for this
I intentionally made this not possible, because this kind of functionality tends to be abused, and is generally not needed to solve any problems elegantly. I personally never want to have to read any Zig code that creates declarations in compile-time logic, I don’t want to have to implement such features in the compiler, and I don’t want to toil through codifying such behavior into a language specification. I am quite satisfied with the relatively simpler language that we enjoy today, without this feature. I consider this decision unlikely to be reversed.