Skip to content

Commit

Permalink
Merge pull request #6497 from WalterBright/fix1707-stable
Browse files Browse the repository at this point in the history
fix Issue 17123 - [REG 2.073] Issues with return @safe inference
  • Loading branch information
MartinNowak committed Jan 29, 2017
2 parents 0341457 + 74f7a29 commit dc279ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/escape.d
Expand Up @@ -524,7 +524,8 @@ private bool checkEscapeImpl(Scope* sc, Expression e, bool refs, bool gag)
* auto dg = () return { return &x; }
* Because dg.ptr points to x, this is returning dt.ptr+offset
*/
sc.func.storage_class |= STCreturn;
if (global.params.vsafe)
sc.func.storage_class |= STCreturn;
}

}
Expand Down
14 changes: 14 additions & 0 deletions test/compilable/fix17123.d
@@ -0,0 +1,14 @@
/*
PERMUTE_ARGS:
https://issues.dlang.org/show_bug.cgi?id=17123
*/

void test()
{
char[256] buffer;

char[] delegate() read = () {
return buffer[];
};
}

0 comments on commit dc279ec

Please sign in to comment.