https://issues.dlang.org/show_bug.cgi?id=20245
Dennis <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |[email protected] Resolution|WORKSFORME |--- --- Comment #2 from Dennis <[email protected]> --- (In reply to moonlightsentinel from comment #1) > Works fine with current master: > > ---------------------------------------------- > @safe int** foo(ref scope int* x) > { > int** a = &x; > return a; > } That only works because `x` is a `scope` pointer, and the compiler can't give double `scope` to it when taking its address. The original example of a non-scope ref still compiles: ``` @safe: int* foo(ref int x) { int* a = &x; return a; } void main() { int* ptr; { int x; ptr = foo(x); } // x escaped via ptr here } ``` --
