Merged DMD commit 1a61d2c8de2fe913bc6cbc45a5bce8f86a88d1aa:

bugzilla 5182 ICE(expression.c): calling unittest from a function
This commit is contained in:
David Nadlinger
2011-04-22 18:45:37 +02:00
parent 90cb596e14
commit feebe880bc

View File

@@ -2195,6 +2195,11 @@ Lagain:
if (!f->originalType && f->scope) // semantic not yet run
f->semantic(f->scope);
if (f->isUnitTestDeclaration())
{
error("cannot call unittest function %s", toChars());
return new ErrorExp();
}
if (!f->type->deco)
{
error("forward reference to %s", toChars());