[Issue 15335] getSymbolsByUDA fails if type has private members

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 21 01:49:55 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15335

bb.temp at gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--- Comment #3 from bb.temp at gmx.com ---
I've looked at your PR on GH and obviously the first one is better since it
just prevents the error.

The accessibility is a more global problem. Every time someone will put a
function related to traits in a module and use this function in another module
the same error will pop up. A mixin template allows to inject the function
related to traits in the module it's used. So far it's ok, let's say for a
private usage, (actually there's --0-- mixin template in phobos so I doubt
they'll ever accept some new functions based on this, even if it works).

Maybe the real solution would be to make "__traits(getMember,...)", and more
generally speaking all the traits verbs that might also block compilation
because of this, able to return any member, regardless of the protection.

Then it would be up to the user to respect or not the protection using an
additional "__traits(getProtection,...)" to filter an item in the traits code.

--


More information about the Digitalmars-d-bugs mailing list