enum sstring problem

Timon Gehr timon.gehr at gmx.ch
Sun Jun 12 17:01:34 PDT 2011


Lloyd Dupont wrote:
> I'm using 2.053
> this compile fine:
> ====
> enum : string
> {
>     A = "hello",
>     B = "betty",
> }
> ====
>
> this doesn't!
> ====
> enum AA : string
> {
>     A = "hello",
>     B = "betty",
> }
> ====
>
> Am I missing something? Named enum can't be typed? known bug?

It works just fine for me.

How I test:

import std.stdio;
enum AA : string
{
    A = "hello",
    B = "betty",
}
void main(){
    writeln(AA.A);
    writeln(AA.B);
}

Compiles and runs.

Timon


More information about the Digitalmars-d-learn mailing list