Bug 5837 – Unable to format (writeln) an enum based on bool
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-04-11T14:07:00Z
Last change time
2011-06-06T12:33:15Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
kennytm
Comments
Comment #0 by kennytm — 2011-04-11T14:07:08Z
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))