www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10552] New: Cannot apply access specifiers to individual anonymous enum members

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552

           Summary: Cannot apply access specifiers to individual anonymous
                    enum members
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



14:00:15 PDT ---
-----
enum
{
    private A = 1,
    B = 2,
}
-----

$ dmd test.d
 Error: basic type expected, not private
-- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |henning still-hidden.de



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552





 -----
 enum
 {
     private A = 1,
     B = 2,
 }
 -----
 
 $ dmd test.d
 Error: basic type expected, not private
I cannot see any benefits there. You can just separate public anonymous enum and private one. private enum { A = 1, } enum { B = 2, } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552




PDT ---

 I cannot see any benefits there.
 You can just separate public anonymous enum and private one.
 
 private enum
 {
     A = 1,
 }
 enum
 {
     B = 2,
 }
This has some drawbacks: 1) You have to write a new enum. 2) You cannot take advantage of the properties of anonymous enums. 3) Constants that belong together need to be defined at the same place. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552




07:08:29 PDT ---


 -----
 enum
 {
     private A = 1,
     B = 2,
 }
 -----
 
 $ dmd test.d
 Error: basic type expected, not private
I cannot see any benefits there. You can just separate public anonymous enum and private one. private enum { A = 1, } enum { B = 2, }
I see it as an unnecessary limitation, each member can have its own type and its own initializer (even its own UDA), but not an access specifier. Note that due to Issue 10552 we can use neither syntax. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com
           Severity|normal                      |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10552




12:20:51 PDT ---
Language changes are enhancements, not bug fixes.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2013