[Issue 7637] writeln doesn't take custom toString into account

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 19 09:45:25 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7637


SomeDude <lovelydear at mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear at mailmetrash.com


--- Comment #1 from SomeDude <lovelydear at mailmetrash.com> 2012-04-19 09:46:20 PDT ---
The above code doesn't compile on 2.059 Win32. 

However this compiles:

import std.stdio;

struct Foo {
    string toString(bool x) { return ""; }
}

void main()
{
    Foo foo;
    writeln(foo.toString(true));  // nogo: ok
    writeln(foo);  // compiles
}



PS E:\DigitalMars\dmd2\samples> rdmd bug.d
toto
Foo()

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list