Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
September 09, 2009 [Issue 3308] New: Enum.RED.stringof gives "Enum", not "Enum.RED" | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=3308 Summary: Enum.RED.stringof gives "Enum", not "Enum.RED" Product: D Version: 2.032 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: echochamber@gmail.com --- Comment #0 from MIURA Masahiro <echochamber@gmail.com> 2009-09-08 19:29:54 PDT --- The sample code in ".stringof Property" section in property.html: ---- cut here ---- module test; import std.stdio; struct Foo { } enum Enum { RED } typedef int myint; void main() { writefln((1+2).stringof); // "1 + 2" writefln(Foo.stringof); // "Foo" writefln(test.Foo.stringof); // "test.Foo" writefln(int.stringof); // "int" writefln((int*[5][]).stringof); // "int*[5][]" writefln(Enum.RED.stringof); // "Enum.RED" writefln(test.myint.stringof); // "test.myint" writefln((5).stringof); // "5" } ---- cut here ---- (I added 'module' and 'import' to make it compilable.) Actual output: ---- cut here ---- 1 + 2 Foo Foo int int*[5u][] Enum myint 5 ---- cut here ---- - Enum.RED.stringof gives "Enum", not "Enum.RED". - Module name "test" is not output. - 5u instead of 5. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 09, 2009 [Issue 3308] Enum.RED.stringof gives "Enum", not "Enum.RED" | ||||
---|---|---|---|---|
| ||||
Posted in reply to MIURA Masahiro | http://d.puremagic.com/issues/show_bug.cgi?id=3308 Jarrett Billingsley <jarrett.billingsley@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jarrett.billingsley@gmail.c | |om --- Comment #1 from Jarrett Billingsley <jarrett.billingsley@gmail.com> 2009-09-08 19:49:46 PDT --- I'm not sure if this is a duplicate of bug 2881 or if it's just closely related. Or if this has just been known for so long but somehow never reported. I always wonder why the compiler seems to hate enums in so many ways.. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 02, 2010 [Issue 3308] Enum.RED.stringof gives "Enum", not "Enum.RED" | ||||
---|---|---|---|---|
| ||||
Posted in reply to MIURA Masahiro | http://d.puremagic.com/issues/show_bug.cgi?id=3308 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #2 from bearophile_hugs@eml.cc 2010-06-02 14:48:13 PDT --- See also bug 4261 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 07, 2012 [Issue 3308] Enum.RED.stringof gives "Enum", not "Enum.RED" | ||||
---|---|---|---|---|
| ||||
Posted in reply to MIURA Masahiro | http://d.puremagic.com/issues/show_bug.cgi?id=3308 Damian <damianday@hotmail.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |damianday@hotmail.co.uk --- Comment #3 from Damian <damianday@hotmail.co.uk> 2012-07-07 08:32:14 PDT --- The example now outputs: 1 + 2 Foo Foo int int*[5u][] cast(Enum)0 int 5 Note that I change typedef -> alias for compatability. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 27, 2013 [Issue 3308] Enum.RED.stringof gives "Enum", not "Enum.RED" | ||||
---|---|---|---|---|
| ||||
Posted in reply to MIURA Masahiro | http://d.puremagic.com/issues/show_bug.cgi?id=3308 Andrej Mitrovic <andrej.mitrovich@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich@gmail.com Resolution| |WORKSFORME --- Comment #4 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-26 18:52:20 PST --- I'm not very happy with Enum.RED.stringof printing "cast(enum)0", but other than that that page is now correct (as long as you compile with -d). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation