https://issues.dlang.org/show_bug.cgi?id=23438 --- Comment #4 from Walter Bright <bugzilla at digitalmars.com> --- A smaller test case: void qux()@safe{ int* foo(return scope int* x)@safe{ int* bar(return scope int* y)@safe{ return x; (*) } return null; } } (*) compiler should complain that x is escaping via return --