Skip to content

Commit

Permalink
Merge pull request #2016 from yebblies/checkassumption
Browse files Browse the repository at this point in the history
[DDMD] Check that matched symbol is always a FuncDeclaration
  • Loading branch information
9rnsr committed May 13, 2013
2 parents 656064c + 480d0a7 commit ae5b0c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/func.c
Expand Up @@ -484,9 +484,12 @@ void FuncDeclaration::semantic(Scope *sc)
if (s)
{
FuncDeclaration *f = s->isFuncDeclaration();
f = f->overloadExactMatch(type);
if (f && f->isFinal() && f->prot() != PROTprivate)
error("cannot override final function %s", f->toPrettyChars());
if (f)
{
f = f->overloadExactMatch(type);
if (f && f->isFinal() && f->prot() != PROTprivate)
error("cannot override final function %s", f->toPrettyChars());
}
}
}

Expand Down

0 comments on commit ae5b0c9

Please sign in to comment.