[Issue 2787] New: Members found in an 'alias this' are not implicitly accessible in methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 2 15:19:19 PDT 2009


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

           Summary: Members found in an 'alias this' are not implicitly
                    accessible in methods
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jarrett.billingsley at gmail.com


struct Base
{
        int x;
        void foo() { writefln("%s", x); }
}

struct Derived
{
        Base _base;
        alias _base this;
        int y;
        void bar() { writefln("%s, %s", x, y); }  // line 16
}

foo.d(16): Error: undefined identifier x

But 'this.x' works.


-- 



More information about the Digitalmars-d-bugs mailing list