Showing with 5 additions and 1 deletion.
  1. +5 −1 src/func.c
6 changes: 5 additions & 1 deletion src/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ void FuncDeclaration::semantic3(Scope *sc)
if (!type->nextOf())
{
((TypeFunction *)type)->next = Type::tvoid;
type = type->semantic(loc, sc);
}
f = (TypeFunction *)type;
}
Expand Down Expand Up @@ -1502,6 +1501,11 @@ void FuncDeclaration::semantic3(Scope *sc)
sc2->pop();
}

if (inferRetType)
{
type = type->semantic(loc, sc);
}

if (global.gag && global.errors != nerrors)
semanticRun = PASSsemanticdone; // Ensure errors get reported again
else
Expand Down