www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7623] New: Allow aliasing of symbols of an aliased subtype


           Summary: Allow aliasing of symbols of an aliased subtype
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com

--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-03-01
15:27:51 PST ---
struct Foo
     property bool isOne() { return true; }

struct Bar
    Foo foo;
    alias foo this;
    alias isOne isTwo;

void main() { }

test.d(10): Error: undefined identifier isOne

Essentially I wanted to partially merge two types which had a similar
structure, but I still wanted to keep the different APIs. I can use property
getters and setters to forward a function, but I thought an alias would help me
more by allowing me to alias a symbol that was going to be merged via the alias
this feature.

So while it's not crucially important, I'm making this a feature request.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 01 2012