On 26 September 2012 20:28, Rainer Schuetze <r.sagitario@gmx.de> wrote:

I think this should be allowed, aswell as implementing forward declared enums and structs (IIRC the compiler even has some error messages that suggest that it is intended).

As a workaround, you could put your prototypes into a struct and generate the declarations for the static linking and the stubs for dynamic linking from their declarations and run your magic on the members of "prototypes":

struct prototypes
{
        void fun1(int a, int b);
        void fun2(int a, int b);
}

mixin(magic([__traits(allMembers, prototypes)])


That way you don't put the symbols into the same scope as the prototypes, and you will not add new symbols to the same scope that you are iterating over.

Good idea! I'll give that a shot.

So it seems like there is fairly general consensus on this then, is there a next step? Should I log a bug? (I think I did log one months ago)