Bug 21252 – parameters inherit function UDAs

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-09-16T01:45:03Z
Last change time
2024-12-13T19:11:34Z
Assigned to
No Owner
Creator
elpenguino+D
Moved to GitHub: dmd#19788 →

Comments

Comment #0 by elpenguino+D — 2020-09-16T01:45:03Z
``` enum A; enum B; static if (is(typeof(& func) Fsym : Fsym*)) { static if (is(Fsym P == function)) { static assert(__traits(getAttributes, P[0 .. 1]).length == 1); static assert(is(__traits(getAttributes, P[0 .. 1])[0] == A)); } } @A void func(@B int) {} ``` The first parameter appears to have both @A and @B applied to it. I would only expect @B. Note that the second assert will fail until issue #21251 is fixed.
Comment #1 by robert.schadek — 2024-12-13T19:11:34Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19788 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB