enum for beginners

Steven Schveighoffer schveiguy at yahoo.com
Tue Nov 15 07:56:35 PST 2011


On Tue, 15 Nov 2011 10:55:44 -0500, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz <johannes at jo-t.de>  
> wrote:
>> Ah, when I compile on the command line with:
>>
>> dmd -g -debug main.d
>>
>> main.d(6): Error: enum main.X base type must be of integral type, not  
>> char[]
>> main.d(8): Error: cannot implicitly convert expression ("a") of type  
>> char[1u] to int
>> main.d(9): Error: cannot implicitly convert expression ("b") of type  
>> char[1u] to int
>
> dmd must map to a D1 version, where string literals were char[N], not  
> immutable(char)[].  In D1, you could not have enums that were strings.

to check, type dmd without args on the command line, it will tell you the  
version.

-Steve


More information about the Digitalmars-d-learn mailing list