www.digitalmars.com         C & C++   DMDScript  

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


           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

--- Comment #0 from Robert Clipsham <robert octarineparrot.com> 2012-04-24
17:54:09 BST ---
struct A {
    int a;
    alias a this;
void main() {
    A t;
    switch(t) {

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