Circular reference error gone after inspecting members

rikki cattermole rikki at cattermole.co.nz
Sat Aug 25 14:13:18 UTC 2018


On 26/08/2018 2:10 AM, Yuxuan Shui wrote:
> The offending code base is a little big and hard to reduce. I'll try if 
> code is required, but here is the gist of the problem:
> 
> This snippet of code in my project:
> 
>      ...
>      alias tmp = genCode!T;
>      enum str = tmp.str; // This line here
>      ...
> 
> Generate a circular reference error.
> 
> However, if I do:
> 
>      ...
>      alias tmp = genCode!T;
>      pragma(msg, __traits(allMembers, tmp));
>      enum str = tmp.str; // This line here
>      ...
> 
> Then the error is gone.
> 
> Anyone has any idea what could the problem be?

If that pragma(msg) does indeed make it disappear (check -v to confirm), 
then its a bug.


More information about the Digitalmars-d-learn mailing list