mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Function literals start again at nesting depth zero.
GitHub: Fixes #447.
This commit is contained in:
parent
e5463f77b7
commit
243146199f
1 changed files with 7 additions and 1 deletions
|
@ -319,7 +319,13 @@ static void DtoCreateNestedContextType(FuncDeclaration* fd) {
|
|||
|
||||
LLStructType* innerFrameType = NULL;
|
||||
unsigned depth = -1;
|
||||
if (!fd->isStatic()) {
|
||||
|
||||
// Static functions and function (not delegate) literals don't allow
|
||||
// access to a parent context, even if they are nested.
|
||||
const bool certainlyNewRoot = fd->isStatic() ||
|
||||
(fd->isFuncLiteralDeclaration() &&
|
||||
static_cast<FuncLiteralDeclaration*>(fd)->tok == TOKfunction);
|
||||
if (!certainlyNewRoot) {
|
||||
if (FuncDeclaration* parfd = getParentFunc(fd, true)) {
|
||||
// Make sure the parent has already been analyzed.
|
||||
DtoCreateNestedContextType(parfd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue