[Issue 9809] New: Need a better diagnostic on accessing 'alias this' to private symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 24 19:39:09 PDT 2013


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

           Summary: Need a better diagnostic on accessing 'alias this' to
                    private symbols
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-24 19:39:08 PDT ---
module foo;

struct S
{
    void func() { }
}

struct X
{
    public alias s this;
    private S s;
}

module test;

import foo;

void main()
{
    X x;
    x.func();
}

$ rdmd test.d
> test.d(8): Error: undefined identifier 'func'

I'm not exactly sure, perhaps the public alias to a private symbol should be
disallowed in the first place. Otherwise a better diagnostic should be made.

-- 
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