www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6481] New: composition with alias this doesn't work inside the struct

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6481

           Summary: composition with alias this doesn't work inside the
                    struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: mrmocool gmx.de



struct Memory
{
    int foo;
}
struct Image
{
    Memory sup;
    alias sup this;

    void bla()
    {
        foo = 1;
    }
}

$ dmd -c test.d 
DMD v2.054 DEBUG
test.d(12): Error: undefined identifier foo

Using this.foo = 1 fixes it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 12 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6481


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 2787 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 14 2011