enum E { AAA = S.BBB } struct S { enum SZAQ = E.AAA; enum BBB = 8080; } ~~~~~ Error: enum member E.AAA circular reference to enum member ~~~~~ S doesn't have to be a struct, this occurs with any ScopeDsymbol or import.
Changing the order of the declarations makes it compile.
PR : https://github.com/dlang/dmd/pull/8371