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

2025-03-31 Thread realhet via Digitalmars-d-learn
On Monday, 31 March 2025 at 14:59:21 UTC, FeepingCreature wrote: On Monday, 31 March 2025 at 13:24:11 UTC, realhet wrote: Can you give a repro? It works here. Ok, I tried and gave up, it's too big. But I've found what is triggering it. The problem roots in circular module imports, and this m

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

2025-03-31 Thread realhet via Digitalmars-d-learn
On Monday, 31 March 2025 at 17:21:03 UTC, realhet wrote: On Monday, 31 March 2025 at 14:59:21 UTC, FeepingCreature wrote: On Monday, 31 March 2025 at 13:24:11 UTC, realhet wrote: Forgot the picture link: [https://ibb.co/1GXKvfQz](https://ibb.co/1GXKvfQz) I'm kinda abusing the circular import

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

2025-03-31 Thread realhet via Digitalmars-d-learn
On Monday, 31 March 2025 at 14:59:21 UTC, FeepingCreature wrote: Can you give a repro? It works here. You are right, I just tested in small scale and it worked. ``` module a; enum EGood:ubyte {e1, e2} mixin(q{enum EBad:ubyte {e1, e2} }); struct Dummy { mixin(q{enum EUgly:ubyte {e1, e2} });

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

2025-03-31 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 31 March 2025 at 13:24:11 UTC, realhet wrote: 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{

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

2025-03-31 Thread realhet via Digitalmars-d-learn
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 fou