Mercurial > projects > ldc
comparison gen/classes.cpp @ 639:8aebdf56c455
Move check for access of context for nested class from backend into frontend.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 02 Oct 2008 23:12:19 +0200 |
parents | 26fce59fe80a |
children | c42173b3557b |
comparison
equal
deleted
inserted
replaced
638:94b01f15814f | 639:8aebdf56c455 |
---|---|
840 else if (tc->sym->isNested() && tc->sym->vthis) | 840 else if (tc->sym->isNested() && tc->sym->vthis) |
841 { | 841 { |
842 Logger::println("Resolving nested context"); | 842 Logger::println("Resolving nested context"); |
843 LOG_SCOPE; | 843 LOG_SCOPE; |
844 | 844 |
845 if (gIR->func()->decl->isStatic()) | |
846 { | |
847 newexp->error("function %s is static and cannot access nested class %s", gIR->func()->decl->toPrettyChars(), tc->sym->toPrettyChars()); | |
848 fatal(); | |
849 } | |
850 | |
851 // get context | 845 // get context |
852 LLValue* nest = DtoNestedContext(loc, tc->sym); | 846 LLValue* nest = DtoNestedContext(loc, tc->sym); |
853 | 847 |
854 // store into right location | 848 // store into right location |
855 size_t idx = 2 + tc->sym->vthis->ir.irField->index; | 849 size_t idx = 2 + tc->sym->vthis->ir.irField->index; |