Bug 21732 – Enum member UDAs compilation is order dependant

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-19T09:55:03Z
Last change time
2024-12-13T19:15:13Z
Assigned to
No Owner
Creator
Eyal
Moved to GitHub: dmd#19889 →

Comments

Comment #0 by eyal — 2021-03-19T09:55:03Z
import std; struct s {} enum X : ubyte { @s A } void failsToBuild() { // getUDAs!(X.A, s) compiles iff it appears *after* __traits(getAttributes, X.A) // i.e: Reverse the order of these 2 pragma msg statements and it builds! pragma(msg, getUDAs!(X.A, s)); pragma(msg, __traits(getAttributes, X.A)); } void compiles() { pragma(msg, __traits(getAttributes, X.A)); pragma(msg, getUDAs!(X.A, s)); }
Comment #1 by boris2.9 — 2021-03-19T22:02:00Z
What version? run.dlang.io shows it's working since 2.092.1
Comment #2 by robert.schadek — 2024-12-13T19:15:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19889 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB