[Issue 19761] New: cannot .mangleof or typeof() a private member.
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Mar 25 04:34:42 UTC 2019
    
    
  
https://issues.dlang.org/show_bug.cgi?id=19761
          Issue ID: 19761
           Summary: cannot .mangleof or typeof() a private member.
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: iamthewilsonator at hotmail.com
struct Foo
{
    import core.thread;
            pragma(mangle, Thread._locks.mangleof) extern __gshared static
                typeof(Thread._locks) _locks;
}
onlineapp.d(4): Deprecation: `core.thread.Thread._locks` is not visible from
module `onlineapp`
onlineapp.d(4): Error: class `core.thread.Thread` member `_locks` is not
accessible
onlineapp.d(5): Deprecation: `core.thread.Thread._locks` is not visible from
module `onlineapp`
onlineapp.d(5): Error: class `core.thread.Thread` member `_locks` is not
accessible
the bogus is not visible can be worked around with 
struct Foo
{
    import core.thread;
        pragma(mangle, __traits(getMember, Thread, "_locks").mangleof) extern
__gshared static
            typeof(__traits(getMember, Thread, "_locks")) _locks;
}
but that still gives
onlineapp.d(4): Error: class `core.thread.Thread` member `_locks` is not
accessible
onlineapp.d(5): Error: class `core.thread.Thread` member `_locks` is not
accessible
--
    
    
More information about the Digitalmars-d-bugs
mailing list