www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7979] New: Alias this does not work with switch

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

           Summary: Alias this does not work with switch
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



17:54:09 BST ---
struct A {
    int a;
    alias a this;
}
void main() {
    A t;
    switch(t) {
        default:
    }
}

With dmd 2.059 this results in:
test.d(7): Error: 't' is not of integral type, it is a A

I believe the alias this should allow this to work.

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