[Issue 7348] to!string(null) matches more than one template declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 22 13:53:14 PDT 2012


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



--- Comment #10 from bearophile_hugs at eml.cc 2012-05-22 13:54:53 PDT ---
Now this code:

import std.conv, std.stdio;
void main() {
    writeln(">", to!string(null), "<");
}


Prints:

><

But I expect something similar to:

>null<

-------------------------

This code:

import std.stdio;
void main() {
    writeln(null);
}

gives:


...\dmd2\src\phobos\std\stdio.d(1562): Error: undefined identifier 'length'
...\dmd2\src\phobos\std\stdio.d(1562): Error: undefined identifier 'ptr', did
you mean 'template tr(C1,C2,C3,C4 = immutable(char))'?
test.d(3): Error: template instance std.stdio.writeln!(typeof(null)) error
instantiating

-- 
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