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

--- Comment #0 from 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.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to