www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11177] New: parameterized enum can't be typed

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

           Summary: parameterized enum can't be typed
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com



The new parameterized/template enum can't be typed.

//----
enum int a    = 5; //OK, a is an enum of type int
enum     b(T) = 5; //OK, b is a template enum is of type infered
template c(T){enum int c = 5;}//OK, c is a template enum is of type int
enum int d(T) = 5; //???
//----

main.d(d): Error: semicolon expected following function declaration
main.d(d): Error: Declaration expected, not '='

I'm not sure what the rules of DIP 42 state on this, but it seems strange this
doesn't work.

I think dmd is getting confused by into thinking I'm declaring a function, but
the "=" and "enum" should mean there is no ambiguity here, and it should be
accepted. I think.

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


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

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



16:19:42 PDT ---
I think there is a pull for this:
https://github.com/D-Programming-Language/dmd/pull/2467

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull




 I think there is a pull for this:
 https://github.com/D-Programming-Language/dmd/pull/2467
Yes. It is for fixing this issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 13 2013