digitalmars.D.learn - enum sstring problem
- Lloyd Dupont (18/18) Jun 12 2011 I'm using 2.053
- Timon Gehr (15/33) Jun 12 2011 It works just fine for me.
- Lloyd Dupont (24/42) Jun 12 2011 do you have DMD 2.053 on Windows?
- Andrej Mitrovic (1/1) Jun 12 2011 I've got 2.053 and it works for me.
- Jos van Uden (1/1) Jun 15 2011 Using 2.053 on win32 (XP), compiles and runs.
- Johann MacDonagh (9/10) Jun 15 2011 Ah! I found the problem. If you're using VisualD it compiles with the -g...
- Johann MacDonagh (5/15) Jun 15 2011 Looks like it is.
- Lloyd Dupont (14/15) Jun 15 2011 Yes indeed, I'm using Visual D
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?
Jun 12 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
Jun 12 2011
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
Jun 12 2011
I've got 2.053 and it works for me.
Jun 12 2011
Using 2.053 on win32 (XP), compiles and runs.
Jun 15 2011
On 6/15/2011 5:32 PM, Jos van Uden wrote:Using 2.053 on win32 (XP), compiles and runs.Ah! I found the problem. If you're using VisualD it compiles with the -g flag (add symbolic debug info), which fails: main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" If you compile with just "dmd main.d" in the command line it works. It's a bug. Anyone know if it's submitted yet?
Jun 15 2011
On 6/15/2011 10:11 PM, Johann MacDonagh wrote:On 6/15/2011 5:32 PM, Jos van Uden wrote:Looks like it is. http://d.puremagic.com/issues/show_bug.cgi?id=5985 There's a patch that hasn't been pulled into dmd proper, but it looks more like a workaround.Using 2.053 on win32 (XP), compiles and runs.Ah! I found the problem. If you're using VisualD it compiles with the -g flag (add symbolic debug info), which fails: main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" If you compile with just "dmd main.d" in the command line it works. It's a bug. Anyone know if it's submitted yet?
Jun 15 2011
Yes indeed, I'm using Visual D Ho... good to know, thanks! :) mm.. well hopefully it'll be fixed in the next release... and I should pay a close look at the build script! "Johann MacDonagh" wrote in message news:itbp22$28l2$1 digitalmars.com... On 6/15/2011 5:32 PM, Jos van Uden wrote:Using 2.053 on win32 (XP), compiles and runs.Ah! I found the problem. If you're using VisualD it compiles with the -g flag (add symbolic debug info), which fails: main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" main.d(4): Error: Integer constant expression expected instead of "hello" main.d(5): Error: Integer constant expression expected instead of "betty" If you compile with just "dmd main.d" in the command line it works. It's a bug. Anyone know if it's submitted yet?
Jun 15 2011









Johann MacDonagh <johann.macdonagh..no spam..gmail.com> 