www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6083] New: There can be only one alias this.

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

           Summary: There can be only one alias this.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



From TDPL, page 231:

"A class could introduce any number of alias this declarations, thus subtyping
any number of types."

Let's test this:

class A{}
class B{}
class C{
    A a;
    B b;
    alias a this;
    alias b this;
}

Error: alias this there can be only one alias this

(I think that error message has a very nice humorous touch!)

The same applies to structs.

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


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com
            Summary|There can be only one alias |[TDPL] There can be only
                   |this.                       |one alias this.



PDT ---
It's a well-known issue. alias this really isn't fully implemented yet and has
lots of bugs to be ironed out. The lack of ability to have more than one alias
this is one of them. I'm not sure that there's a bug report on it though, so
it's good to have a placeholder for the issue.

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