www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23511] New: Incrementing a not supported type in enum

https://issues.dlang.org/show_bug.cgi?id=23511

          Issue ID: 23511
           Summary: Incrementing a not supported type in enum
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: porton narod.ru

As expected, DMD does not compile this:

enum {
    string A = "12",
    B,
}

But AFAIK nothing in the specification implies that this is not compilable. I
can devise other possible interpretations of the specification than being not
compilable, for example, undefined behavior.

Need to say in the specification that stuff like this does not compile.

--
Nov 26 2022