A little unsurprising, but quite annoying. See this simple test case:
void main() {
import std.stdio;
import std.typecons;
Nullable!(float, float.nan) Value;
writeln(Value.isNull, " <- should be true");
Value.nullify();
writeln(Value.isNull, " <- should be true");
};
Value.isNull always evaluates to false.
A simple patch in typecons.d seems to resolve the issue,
in the isNull function on line 1478, replace
return _value == nullValue;
with
return _value is nullValue;
I don't *think* this change could cause other issues, but I'm not completely certain.
Tested using DMD v2.063.2 on WinXP.