do you have DMD 2.053 on Windows? Your code fail for me with: ==== main.d(10): Error: Integer constant expression expected instead of "hello" main.d(11): Error: Integer constant expression expected instead of "betty" main.d(10): Error: Integer constant expression expected instead of "hello" main.d(11): Error: Integer constant expression expected instead of "betty" =====
"Timon Gehr" wrote in message news:it3k0u$15s6$1...@digitalmars.com...
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