Skip to content

Commit

Permalink
Merge pull request #4031 from 9rnsr/fix13550
Browse files Browse the repository at this point in the history
[REG2.067a] Issue 13550 - Inner functions take outer function attributes erroneously
  • Loading branch information
yebblies committed Sep 29, 2014
2 parents 18e0968 + d8df4bf commit 5118d69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/func.c
Expand Up @@ -1863,7 +1863,7 @@ void FuncDeclaration::semantic3(Scope *sc)
exp->checkEscape();
}

exp = checkGC(sc, exp);
exp = checkGC(sc2, exp);

if (vresult)
{
Expand Down
12 changes: 12 additions & 0 deletions test/compilable/nogc.d
Expand Up @@ -97,3 +97,15 @@ static if (is(__vector(ulong[2])))
return [0, 0];
}
}

/******************************************/
// 13550

auto foo13550() @nogc
{
static int[] bar()
{
return new int[2];
}
return &bar;
}

0 comments on commit 5118d69

Please sign in to comment.