Bug 7869 – Cannot format pointer of struct has toString member function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-08T22:30:00Z
Last change time
2012-04-09T00:10:45Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2012-04-08T22:30:33Z
Original reporter is Vladimir Panteleev. http://forum.dlang.org/thread/[email protected]?page=2#post-op.wchbzrtnq1euq9:40cybershadow.mshome.net // test.d struct S { int n; string toString() { return null; } } void main() { S*[] all; sort!q{a.n > b.n}(all); } With following command line: dmd -debug -run test.d prints a wall of error messages. ---- This is std.format problem. //Reduced test case: import std.stdio; void main() { struct S { string toString() { return null; } } S* p; writefln("%s", p); }
Comment #1 by k.hara.pg — 2012-04-08T22:33:22Z
Comment #2 by github-bugzilla — 2012-04-08T23:59:17Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/9e37c2aecc3e8f4cd733dbbaf504b4812c07d89b fix Issue 7869 - Cannot format pointer of struct has toString member function https://github.com/D-Programming-Language/phobos/commit/d862f1f0787a1b69d44e584dbd9d0f0b96fba701 Merge pull request #532 from 9rnsr/fix_pointer_fmt Issue 7869 - Cannot format pointer of struct has toString member function