digitalmars.D.bugs - metastrings.ToString
- alcohol (21/23) Apr 05 2007 A bug in Phobos.
A bug in Phobos. --- foo.d --- import std.metastrings; pragma(msg,ToString!(0x100000000)); void main() {} -------------dmd foo.d0 D:\tool\program\d\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi; An above result is bug. A correct result is:dmd test.d4294967296 D:\tool\program\d\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi; Need To modify std/metastrings.d: /// ditto template ToString(long I) { static if (I < 0) const char[] ToString = "-" ~ ToString!(cast(ulong)(-I)); else const char[] ToString = ToString!(cast(uint)I); // <- "uint" to "ulong" }
Apr 05 2007