https://issues.dlang.org/show_bug.cgi?id=19812
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Walter Bright <[email protected]> --- (In reply to Suleyman Sahmi (سليمان السهمي) from comment #1) > Another similar case > > ``` > auto makeI(int m) @safe > { > static struct S > { > int m; > auto inner() // adding `return` attribute here > { > class I > { > auto get() @safe { return m; } > } > return new I; > } > } > scope s = S(m); > return s.inner(); // causes correct error returning `s.inner()` escapes a > reference to local variable `s` > } --
