https://issues.dlang.org/show_bug.cgi?id=5270
--- Comment #4 from [email protected] --- Another failing case that illustrates the problem: ------ int delegate() globDg; void func(scope int delegate() dg) { globDg = dg; // should be rejected but isn't globDg(); } void sub() { int x; func(() { return ++x; }); } void trashme() { import std.stdio; writeln(globDg()); // prints garbage } void main() { sub(); trashme(); } ------ --
