www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10604] New: Not consistent access check for overloaded symbols

http://d.puremagic.com/issues/show_bug.cgi?id=10604

           Summary: Not consistent access check for overloaded symbols
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



Test case:

moduel a;
version(A)
{
    private template X(T) { enum X = 1; }
    public  template X(size_t n) { enum X = 2; }

    private void foo(int) {}
    public  void foo(string) {}
}
version(B)
{
    public  template X(size_t n) { enum X = 2; }
    private template X(T) { enum X = 1; }

    public  void foo(string) {}
    private void foo(int) {}
}

module b;
import a;
void main()
{
                        // version=A    B
    auto x1 = X!int;    //  Error       OK
    auto x2 = X!100;    //  Error       OK

    foo(100);           //  Error       Error
    foo("a");           //  Error       OK
}

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