Function Function.withReturnType

Return a new Function object with the returnType attribute set to value.

immutable(Function) withReturnType (
  string value
) immutable;

Example

pure int answer() { return 42; }
mixin(
    refract!(answer, "answer")
    .withName("realAnswer")
    .withReturnType("real")
    .mixture);
static assert(is(typeof(realAnswer()) == real));
static assert(functionAttributes!realAnswer & FunctionAttribute.pure_);