But I'd rather avoid such things if possible. Is there a way around this? Seems rather limiting that I can do:
Is this what you're looking for?
void foo(Nullable!int x = Nullable!int.init) { if (!x.isNull) x.get.writeln; else writeln; } void foo(int x) { return Nullable!int(x).foo; } void main() { foo(1); // 1 int x; foo(x++); // 0 foo; // empty line foo(x); // 1 readln(); }