https://issues.dlang.org/show_bug.cgi?id=15660
Steven Schveighoffer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid CC| |[email protected] Hardware|x86_64 |All OS|Linux |All --- Comment #2 from Steven Schveighoffer <[email protected]> --- This doesn't require member functions. int[] f(ref void[] m) pure { auto result = new int[5]; m = result; return result; } void main() { void[] v; immutable x = f(v); } One significant problem here is that the compiler may not consider the parameter to f in these cases to be a *return* avenue, only a parameter. The compiler should take into account references to ensure that they cannot escape the same data that is being returned. Fixing this may break a lot of code, but probably for the better. May need a deprecation cycle for this. --
