Skip to content

Commit

Permalink
Backport semantic order fix for delegates
Browse files Browse the repository at this point in the history
Issue uncovered by recent mangling fixes. Full D2 PR this change
originates from is #1096
but most stuff there is for pure/@safe and thus not applicable to
D2.
  • Loading branch information
mihails-strasuns-sociomantic committed Nov 25, 2015
1 parent 0ff63cc commit 73903a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/func.c
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

0 comments on commit 73903a4

Please sign in to comment.