Can't access enum from a different module when it was generated by a string mixin.

realhet real_het at hotmail.com
Mon Mar 31 13:24:11 UTC 2025


Hello,

I have a module with an enum declaration: `module a; enum 
E:ubyte{ e1, e2 }`

I can import it into a different module: `module b; import a : E;`

But if I generate the enum with a string mixin: `module a; 
mixin(q{enum E:ubyte{ e1, e2 }});`

I get an error: module `a` import `E` not found.

My question is: Why? And how to fix it? It prevents me from 
splitting into smaller modules.

These are just metadata, I don't want to use static immutable 
arrays, an enumerated tyope would be perfect.  And it's a string 
mixin because I automatically generate it from an 'excel' table.

Thank You in advance!



More information about the Digitalmars-d-learn mailing list