https://issues.dlang.org/show_bug.cgi?id=24211
Paul Backus <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |safe --- Comment #3 from Paul Backus <[email protected]> --- This bug creates a hole in @safe when combined with "Inferred scope parameters in pure functions" [1]. --- void main() @safe { const(int)* escaped; @safe pure nothrow void fun(const(int)* p) const { escaped = p; } int n; fun(&n); } --- Because fun's context is const, the compiler can assume that "None of the other parameters [aside from p] have mutable indirections," and allow the use of a scope pointer as an argument. If not for this bug, that assumption would be correct. [1] https://dlang.org/spec/function.html#pure-scope-inference --
