TEST CASE: --- auto foo() { typeof(return) result; return result; } --- PATCH: TypeReturn::semantic(), mtype.c, line 5236 Type *TypeReturn::semantic(Loc loc, Scope *sc) { Type *t; if (!sc->func) { error(loc, "typeof(return) must be inside function"); goto Lerr; } t = sc->func->type->nextOf(); + if (!t) + { error(loc, "typeof(return) cannot infer type"); + goto Lerr; + } t = t->addMod(mod);
Fixed dmd 2.037