[Issue 11177] New: parameterized enum can't be typed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 5 13:53:35 PDT 2013
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 at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2013-10-05 13:53:34 PDT ---
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: -------
More information about the Digitalmars-d-bugs
mailing list