https://issues.dlang.org/show_bug.cgi?id=21286
--- Comment #5 from Paul Backus <[email protected]> --- Perhaps more to the point, the bigger problem is that from the outside, the compiler has no way to distinguish between these two implementations of getRef: --- @safe: int global; ref int* getRef1(return ref int* p) => p; ref int* getRef2(return ref int* p) => global; --- Allowing a scope pointer to be assigned to the return value of getRef2 would clearly be a mistake, so it has to be forbidden in general. You could maybe justify allowing the assignment if getRef were a pure function, but giving pure functions special exemptions from the normal safety rules has bitten us in the past, and it's still just a band-aid over the real problem (lack of explicit lifetimes), so I wouldn't recommend it. --
