[Issue 10285] Enum grammar documentation is incorrect

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Apr 22 15:25:53 PDT 2014


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

Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> ---
(In reply to brian-schott from comment #0)
> The documentation for EnumMember states that it can consist of "type '='
> assignExpression", but comments in the the compiler source code indicate
> that this should actually be "type Identifer '=' assignExpression".

You mean this?:

-----
alias Base = int;
enum : Base
{
    x = 1
}
-----

This is a supported feature.

> Another issue is that the grammar does not disallow the "type Identifier '='
> assignExpression" syntax if the enum has a name or base type specified, but
> DMD's parser does.

I'm not sure what exactly the parser disallows. Can you post an example?

--


More information about the Digitalmars-d-bugs mailing list