www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5837] New: Unable to format (writeln) an enum based on bool

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5837

           Summary: Unable to format (writeln) an enum based on bool
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: kennytm gmail.com



Test program:

----------------

import std.stdio;

enum A : bool { no, yes }

void main () {
    writeln(A.no);
}

----------------

This results in an error:

/usr/include/phobos/std/format.d(1599): Error: template
std.format.formatValue(Writer,T,Char) if (is(const(T) == const(void[])))
formatValue(Writer,T,Char) if (is(const(T) == const(void[]))) matches more than
one template declaration,
/usr/include/phobos/std/format.d(868):formatValue(Writer,T,Char) if (is(T ==
enum)) and /usr/include/phobos/std/format.d(1079):formatValue(Writer,T,Char) if
(is(T : bool))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 11 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5837


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch





https://github.com/D-Programming-Language/phobos/pull/72

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 02 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5837


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



https://github.com/D-Programming-Language/phobos/commit/0110322cb25ba1e6b3a5f5f7d3d9b055668d5f0d

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