[Issue 11998] New: writeln with string enum outputs the enum name, not the string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 25 17:08:07 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11998

           Summary: writeln with string enum outputs the enum name, not
                    the string
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2014-01-25 17:08:01 PST ---
cat > bug.d << CODE
enum Enum : string
{
    member = "printThis",
}

void main()
{
    import std.stdio : writeln;
    writeln(member);
}
CODE

dmd -run bug

----
Output is 'member' instead of 'printThis'.
See http://dpaste.dzfl.pl/e801e755
----

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list