Fixed uncaught, invalid use of nesting introduced in rev [498]

This commit is contained in:
Tomas Lindquist Olsen 2008-08-13 17:11:03 +02:00
parent aae027961c
commit 7ffb43fdc6

View file

@ -834,6 +834,12 @@ DValue* DtoNewClass(Loc loc, TypeClass* tc, NewExp* newexp)
Logger::println("Resolving nested context");
LOG_SCOPE;
if (gIR->func()->decl->isStatic())
{
gIR->func()->decl->error("is static and cannot access nested class %s", tc->sym->toChars());
fatal();
}
// get context
LLValue* nest = DtoNestedContext(loc, tc->sym);