static assert(__traits(compiles, () => "failure".err)); static assert(is(typeof(() { return "failure".err; } ()) == Err!string)); static assert(__traits(compiles, function Result!int() => "failure".err));
See Implementation