https://issues.dlang.org/show_bug.cgi?id=17449
--- Comment #1 from Rainer Schuetze <r.sagita...@gmx.de> --- Reduced test: void main() { void delegate() dg; void savedg(void delegate() h) { dg = h; } void foo(int x) { savedg({ assert(x == 42); }); } foo(42); dg(); } Assertion failure with -dip1000, fine without. It is also ok if dg is made global, so maybe escape analysis fails for local functions only. --