www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10267] New: Access checks should be relaxed in some contexts


           Summary: Access checks should be relaxed in some contexts
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com

--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-06-04
08:57:03 PDT ---
Currently we can't filter out function overloads which are non-accessible. As
soon as one of a functions overloads is inaccessible the getOverloads trait
will fail, essentially making the getProtection trait also unusable. For


module foo;

struct S
    private void x(int) { }     // private overload
    public void x(float) { }   // public overload

module test;
import foo;

void main()
    foreach (member; __traits(allMembers, S))
        // Error: struct foo.S member x is not accessible
        foreach (overload; __traits(getOverloads, S, member))
            // too late, already errored out
            static if (__traits(getProtection, overload) == "public")
                // ... do something if accessible

Some comments:


Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 04 2013