http://d.puremagic.com/issues/show_bug.cgi?id=8040
Summary: writeln(null) too Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2012-05-04 12:55:24 PDT --- Problem found by Ali �ehreli. D2 code: import std.stdio: writeln; class Foo {} struct Bar {} void main() { Foo f = null; writeln(f); Bar* b = null; writeln(b); writeln(null); } Expected output similar to: cast(Foo)null cast(Bar*)null null DMD 2.056 prints "null" in the first two writeln, and gives errors for the third one: ...\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(9): 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: -------