digitalmars.D.bugs - [Issue 2899] New: Object.toString is not declared const
- d-bugmail puremagic.com (24/24) Apr 25 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2899
- d-bugmail puremagic.com (6/6) Apr 26 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2899
- d-bugmail puremagic.com (11/11) May 27 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2899
http://d.puremagic.com/issues/show_bug.cgi?id=2899 Summary: Object.toString is not declared const Product: D Version: 2.029 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: bugzilla digitalmars.com ReportedBy: someanon yahoo.com I don't have a code snippets, but in dmd-v2.029/src/phobos/std/format.d:2054 else static if (is(const(D) : const Object)) { // BUG 2367 //if (obj is null) w.write("null"); if (obj is null) w.put("null"[]); else w.put(obj.toString); // 2054 } dmd/linux/bin/../bin/../../src/phobos/std/format.d(2054): Error: obj.toString can only be called on a mutable object, not const(...) This because Object.toString is not declared const. So how to fix this? --
Apr 25 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2899 I changed line 2054 to: else w.put((cast(Object)obj).toString); it seems to be working. --
Apr 26 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2899 Sobirari Muhomori <maxmo pochta.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE PDT --- *** This issue has been marked as a duplicate of issue 1824 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 27 2009