https://issues.dlang.org/show_bug.cgi?id=13116
--- Comment #1 from [email protected] --- Better yet, the following variation shows @safe breakage: ---- import std.stdio; class C { int x; this(int _x) { x = _x; } ref C evil() @safe { return this; // <-- should not compile but does } } void hmm(int x, int y, ref C c) { () @safe { c = null; // corrupt memory -- in @safe block }(); writefln("%d %d", x, y); // prints "0 2" } void main() { auto c = new C(1); auto d = new C(2); hmm(1, 2, c.evil()); // N.B., we passed 1 and 2 to hmm() } ---- --
