string enums

Namespace rswhite4 at googlemail.com
Sat Apr 27 11:41:43 PDT 2013


On Saturday, 27 April 2013 at 18:34:24 UTC, Lodo wrote:
> Hi!
> I'm having some troubles with an enum with base type string.
> Here's the code:
>
> enum Type:string
> {
> 	DOT="DOT",
> 	ID="ID",
> 	MODULE="MODULE",
> 	SEMICOLON="SEMICOLON",
> 	ERROR="ERROR",
> 	EOF="EOF"
> }
>
> For every element of the enum, dmd writes this message two 
> times:
>  Integer constant expression expected instead of "DOT"
> (with "ID", "MODULE", ... instead of "DOT")
>
> Am I doing something wrong?
>
> Thanks in advance.
>
>       Lodo

Works fine for me with dmd >= 2.062


More information about the Digitalmars-d-learn mailing list