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

           Summary: enum x = CustomType; should be a syntax error
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-03-30 08:15:15 PDT ---
Currently (v2.052) it is possible to do

-------

struct Bar {    // Bar can be a struct, a class, a union or an enum.
    int x;
    int y;
}

void main() {
    enum z = Bar;      // <------
    auto w = z(1, 2);
}

-------

The effect is the same as 'alias Bar z;'. However, the RHS of an 'enum'
statement should only accept an AssignExpression, not a custom type. Either the
D compiler should reject this, or the spec should be clarified to allow this.

In 2.042 this was a syntax error. http://ideone.com/BNcSh

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

Reply via email to