[Issue 634] New: writef doesn't work on enums

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 2 18:46:44 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=634

           Summary: writef doesn't work on enums
           Product: D
           Version: 0.175
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: smjg at iname.com


----------
import std.stdio;

enum Qwert { Yuiop, Asdfg }

void main() {
    writefln(Qwert.Yuiop);
}
----------
Error: std.format formatArg
----------

The same happens with either

    writefln("%s", Qwert.Yuiop);

or

    writefln("%d", Qwert.Yuiop);

It may be the case that formatting of enums isn't yet implemented.  But would
it do any harm to have it just write out the numerical value for the meantime? 
In particular, there's no reason that the %d format shouldn't already work on
them.


-- 




More information about the Digitalmars-d-bugs mailing list