Bug 17643 – std.traits.getSymbolsByUDA doesn't work with private attributes

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-07-13T00:24:30Z
Last change time
2018-02-17T22:13:45Z
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greensunny12 — 2017-07-13T00:24:30Z
There's currently a publicly documented example about using getSymbolsByUDA with private attributes. This only works because the example is in std.traits > dmd -c test.d tuple(a) --- import std.traits; enum Attr; struct A { @Attr int a; @Attr private int c; } pragma(msg, getSymbolsByUDA!(A, Attr).stringof); ---
Comment #1 by razvan.nitu1305 — 2017-07-14T10:30:48Z
Could you pinpoint the exact location of the example? I can't find it in std/traits.d
Comment #2 by razvan.nitu1305 — 2017-07-14T10:33:22Z
Anyway, this probably is the correct behaviour.
Comment #3 by greeenify — 2017-07-14T10:33:47Z
Comment #4 by dlang-bugzilla — 2017-07-15T05:53:06Z
- Started working with https://github.com/dlang/phobos/pull/3827, which allowed getSymbolsByUDA to work on private members - https://github.com/dlang/dmd/pull/5530 caused accessing the field result in a deprecation, but it still worked (and returned both members) - https://github.com/dlang/phobos/pull/5344 has broken this completely. This certainly seems like a regression, but I'm not sure I can put the blame entirely on either of those PRs.
Comment #5 by the.mail.of.mi2 — 2018-02-17T22:13:45Z
It duplicates the #15335, which - despite the merged PR - still persists or have been revived. *** This issue has been marked as a duplicate of issue 15335 ***