Issue 17656 - Enum member circular reference error
Summary: Enum member circular reference error
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2017-07-16 00:38 UTC by Elie Morisse
Modified: 2022-12-17 10:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Elie Morisse 2017-07-16 00:38:07 UTC
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.
Comment 1 Vladimir Panteleev 2017-07-17 04:14:11 UTC
Changing the order of the declarations makes it compile.
Comment 2 RazvanN 2018-06-18 14:55:47 UTC
PR : https://github.com/dlang/dmd/pull/8371