I've tried to write an 'assert function' in D, one that doesn't trigger the 'function must return a value or assert' error.

Basically something like:

Never neverReturns() { assert(0); }

or

@noreturn auto neverReturns() { assert(0); }

and

int tryMe(bool f) {
    if(f) return 42;
    else neverReturns();
}

Then have the call on line 2 in `tryMe` be accepted by the compiler.

Reply via email to