https://issues.dlang.org/show_bug.cgi?id=18738
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from [email protected] --- I think is a similar bug: ``` @safe: import std.stdio : writeln; void main() { int* x = escape(); writeln("x is ", *x); // x is 1 *x = 5; escape(); writeln("x is ", *x); // x is 1 } pure @nogc nothrow: int* escape() { int* res; callbackWithPointer([1, 2, 3], (int* i) { res = i; }); return res; } void callbackWithPointer(T)(scope T[] a, scope void delegate(T*) @safe @nogc pure nothrow f) { f(&a[0]); } ``` In this case a `pure` function `escape` appears to return a pointer to global state. `f(&a[0])` probably shouldn't be allowed. The delegate expects a `T*` but gets a `scope T*`. --
