https://issues.dlang.org/show_bug.cgi?id=5270
--- Comment #6 from Walter Bright <bugzi...@digitalmars.com> --- (In reply to hsteoh from comment #4) > 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(); > } Annotating func() with @safe results in: test3.d(4): Error: scope variable dg assigned to non-scope globDg with Pull Request: https://github.com/dlang/dmd/pull/5972 This check is limited to @safe code to avoid breaking too much existing code. --