[Issue 11390] New: const(typeof(null)) fails to print correctly
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 30 14:46:25 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11390
Summary: const(typeof(null)) fails to print correctly
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: simen.kjaras at gmail.com
--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2013-10-30 14:46:22 PDT ---
In the following cases, empty string is returned:
import std.conv : to;
const(typeof(null)) ctn;
immutable(typeof(null)) itn;
assert(ctn.to!string == "");
assert(itn.to!string == "");
Also, writeln fails horribly when confronted with a const or immutable typeof
null:
import std.stdio : writeln;
const(typeof(null)) ctn;
immutable(typeof(null)) itn;
writeln(ctn);
writeln(itn);
phobos\std\stdio.d(1906): Error: no property 'length' for type 'typeof(null)'
phobos\std\stdio.d(1906): Error: no property 'ptr' for type 'typeof(null)'
.\foo.d(77): Error: template instance std.stdio.writeln!(typeof(null)) error
instantiating
See also bug 11226.
--
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