[Issue 3308] New: Enum.RED.stringof gives "Enum", not "Enum.RED"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 8 19:29:56 PDT 2009
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 at puremagic.com
ReportedBy: echochamber at gmail.com
--- Comment #0 from MIURA Masahiro <echochamber at 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: -------
More information about the Digitalmars-d-bugs
mailing list