Skip to content

Commit

Permalink
fix Issue 13550 - Inner functions take outer function attributes erro…
Browse files Browse the repository at this point in the history
…neously
  • Loading branch information
9rnsr committed Sep 29, 2014
1 parent 18e0968 commit d8df4bf
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 d8df4bf

Please sign in to comment.