Bug 11177 – parameterized enum can't be typed

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-05T13:53:00Z
Last change time
2014-04-26T19:06:29Z
Keywords
pull
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2013-10-05T13:53:34Z
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.
Comment #1 by andrej.mitrovich — 2013-10-05T16:19:42Z
Comment #2 by k.hara.pg — 2013-10-13T00:05:51Z
(In reply to comment #1) > I think there is a pull for this: > https://github.com/D-Programming-Language/dmd/pull/2467 Yes. It is for fixing this issue.