[Issue 8304] writeln of empty Nullables too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 19 19:43:13 PDT 2013


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



--- Comment #1 from bearophile_hugs at eml.cc 2013-03-19 19:43:12 PDT ---
In DMD 2.063alpha if you print a const null Nullable:


import std.stdio: writeln;
import std.typecons: Nullable;
void main() {
    auto a = Nullable!int(10);
    writeln(a);
    auto b = const(Nullable!int)(10);
    writeln(b);
    const(Nullable!int) c;
    writeln(c);
    Nullable!int d;
    writeln(d);
}


You get:


10
const(Nullable!(int))(10, false)
const(Nullable!(int))(0, true)
==> core.exception.AssertError at C:\dmd2\src\phobos\std\typecons.d(1212): Called
`get' on null Nullable!int.

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