Thread overview
[Issue 10285] Enum grammar documentation is incorrect
Apr 22, 2014
Andrej Mitrovic
Apr 22, 2014
Andrej Mitrovic
Apr 24, 2014
Andrej Mitrovic
Jan 18, 2015
Kenji Hara
April 22, 2014
https://issues.dlang.org/show_bug.cgi?id=10285

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

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

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@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?

--
April 22, 2014
https://issues.dlang.org/show_bug.cgi?id=10285

--- Comment #2 from brian-schott@cox.net ---
The compiler accepts this even though it makes no sense:

enum
{
    int = 5
}

The compiler rejects this though the grammar allows it:

enum A
{
    int b = 5
}

--
April 22, 2014
https://issues.dlang.org/show_bug.cgi?id=10285

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Assignee|nobody@puremagic.com        |andrej.mitrovich@gmail.com

--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
(In reply to brian-schott from comment #2)
> The compiler accepts this even though it makes no sense:
> 
> enum
> {
>     int = 5
> }

https://github.com/D-Programming-Language/dmd/pull/3487

A spec pull will have to be made for the second issue.

--
April 24, 2014
https://issues.dlang.org/show_bug.cgi?id=10285

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/610b68e795a67bd0cb4c362caa2905a6ddfcf1a7
Fix Issue 10285 - Enum member with a type but no identifier should not be
allowed.

https://github.com/D-Programming-Language/dmd/commit/90abd4c6cdfd2f2672c338c3eb491d177dcae937 Merge pull request #3487 from AndrejMitrovic/Fix10285

Issue 10285 - Enum member with a type but no identifier should not be allowed.

--
April 24, 2014
https://issues.dlang.org/show_bug.cgi?id=10285

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #5 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Reopened, a spec pull is still needed for the second issue.

--
January 16, 2015
https://issues.dlang.org/show_bug.cgi?id=10285

--- Comment #6 from briancschott@gmail.com ---
https://github.com/D-Programming-Language/dlang.org/pull/775

--
January 18, 2015
https://issues.dlang.org/show_bug.cgi?id=10285

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/15459d2af1349016f108b26e67be6312bef6e62c Issue 10285 - Enum grammar documentation is incorrect

https://github.com/D-Programming-Language/dlang.org/commit/d054391c6b4127e8694ec805bb6fa5c41bdfd996 Merge pull request #775 from Hackerpilot/issue-10285

Issue 10285 - Enum grammar documentation is incorrect

--
January 18, 2015
https://issues.dlang.org/show_bug.cgi?id=10285

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
            Version|D1 & D2                     |D2
         Resolution|---                         |FIXED

--