[Issue 22052] Struct array initializer for enum member fails to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 21 06:54:00 UTC 2021


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

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com
           Severity|normal                      |enhancement

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
This is not supposed to work actually, so changed the importance to
enhancement.

By [1] the construct exepected here is

```ebnf
Type Identifier "=" AssignExpression
```

while struct initializer is part of another rule, i.e Initializer ([2])

The enhancement would be to have

```ebnf
Type Identifier "=" Initializer
```

[1] https://dlang.org/spec/enum.html#AnonymousEnumMember
[2] https://dlang.org/spec/declaration.html#Initializer

--


More information about the Digitalmars-d-bugs mailing list