digitalmars.D.bugs - [Issue 626] New: std.format.doFormat accepts non-string arrays with any format specifier
- d-bugmail puremagic.com (33/33) Dec 02 2006 http://d.puremagic.com/issues/show_bug.cgi?id=626
- d-bugmail puremagic.com (10/10) Oct 11 2009 http://d.puremagic.com/issues/show_bug.cgi?id=626
- d-bugmail puremagic.com (13/13) Sep 13 2010 http://d.puremagic.com/issues/show_bug.cgi?id=626
http://d.puremagic.com/issues/show_bug.cgi?id=626 Summary: std.format.doFormat accepts non-string arrays with any format specifier Product: D Version: 0.175 Platform: PC OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P3 Component: Phobos AssignedTo: bugzilla digitalmars.com ReportedBy: deewiant gmail.com import std.stdio; void main() { int[] x = [1,2,3]; int[3] y = [1,2,3]; int* z = [1,2,3]; // work, incorrectly writefln("%3.2f", [1,2,3]); writefln("%3.2f", x); writefln("%3.2f", y); writefln("%d", [1,2,3]); writefln("%d", x); writefln("%d", y); writefln("--"); // fail, correctly writefln("%3.2f", z); writefln("%d", z); writefln("%3.2f", ['f','o','o']); } --
Dec 02 2006
http://d.puremagic.com/issues/show_bug.cgi?id=626 Andrei Alexandrescu <andrei metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |andrei metalanguage.com AssignedTo|nobody puremagic.com |andrei metalanguage.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 11 2009
http://d.puremagic.com/issues/show_bug.cgi?id=626 Andrei Alexandrescu <andrei metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED 20:26:11 PDT --- writefln("%d", [1,2,3]) works as designed - arrays pass down the format spec to each of their elements. http://www.dsource.org/projects/phobos/changeset/1998 takes care of the rest. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 13 2010