Accessing enum member attributes, throwing an "undefined identifier" error (at CT), if the attributes of the member are not first accessed in the scope which the attribute is defined in. This code exemplifies the error: ``` import std; template T(E) { pragma(msg, __traits(getAttributes, E.a)); enum T = null; } void main() { class C {} enum E { @C a } ////pragma(msg, __traits(getAttributes, E.a)); pragma(msg, T!E); } ``` Uncommenting the commented out line, makes the error not happen.
*** Issue 19344 has been marked as a duplicate of this issue. ***
@BorisCarvajal created dlang/dmd pull request #11163 "Fix issue 20835 - Enum member attributes being evaluated in wrong scope." fixing this issue: - Fix issue 20835 - Enum member attributes being evaluated in wrong scope. https://github.com/dlang/dmd/pull/11163
dlang/dmd pull request #11163 "Fix issue 20835 - Enum member attributes being evaluated in wrong scope." was merged into stable: - d76f8c37f637e9b393eef0306c4467566e1044fd by Boris Carvajal: Fix Issues 20835, 19344 - Enum member attributes being evaluated in wrong scope. https://github.com/dlang/dmd/pull/11163