still present on 2.056 (running on Win7 x64).
however, problem happens only when enum is named.
for example, the following compiles fine:
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
whereas the following fails:
enum X : string
{
a = "a", // Error: Integer constant expression expected
// instead of "a"
b = "b" // Error: Integer constant expression expected
// instead of "b"
}
int main(string[] argv)
{
writeln(X.a);
return 0;
}
Comment #2 by Jesse.K.Phillips+D — 2011-11-16T09:04:05Z
*** Issue 5985 has been marked as a duplicate of this issue. ***
Comment #3 by lovelydear — 2012-04-22T02:16:52Z
Compiles and runs fine on 2.059 Win32.
Comment #4 by Jesse.K.Phillips+D — 2012-04-23T08:29:36Z
(In reply to comment #3)
> Compiles and runs fine on 2.059 Win32.
I'm still getting these errors
test.d(4): Error: Integer constant expression expected instead of "a"
when compiling the named enum version with -g option.
Comment #5 by lovelydear — 2012-04-23T08:55:58Z
Indeed. I overlooked the -g option. Sorry for that.
Comment #6 by simen.kjaras — 2012-07-26T14:16:09Z
*** Issue 8445 has been marked as a duplicate of this issue. ***