https://issues.dlang.org/show_bug.cgi?id=17449
Walter Bright <bugzi...@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |WORKSFORME --- Comment #7 from Walter Bright <bugzi...@digitalmars.com> --- Fixing the code with @safe and @trusted: --- module test; @safe: struct Event9834 { @safe: void delegate() dg; void set(void delegate() @safe h) pure { dg = h; } // AV occurs void call() { dg(); } } void main() { Event9834 ev; auto a = new class { Object o; this() @safe { o = new Object; ev.set(() @trusted { o.toString(); }); } }; ev.call(); } --- and it compiles and runs without error, with or without -dip1000. --