[Issue 10604] New: Not consistent access check for overloaded symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 10 19:08:45 PDT 2013


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 at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-10 19:08:40 PDT ---
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: -------


More information about the Digitalmars-d-bugs mailing list