Skip to content

Commit

Permalink
bugzilla 3494
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Bright committed Nov 22, 2009
1 parent 36397f4 commit dd08136
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mtype.c
Expand Up @@ -5291,6 +5291,11 @@ Type *TypeReturn::semantic(Loc loc, Scope *sc)
goto Lerr;
}
t = sc->func->type->nextOf();
if (!t)
{
error(loc, "cannot use typeof(return) inside function %s with inferred return type", sc->func->toChars());
goto Lerr;
}
t = t->addMod(mod);

if (idents.dim)
Expand Down

0 comments on commit dd08136

Please sign in to comment.