The following code fails to compile: void foo (inout int[] arr) { auto dg = { foreach (i, e ; arr) {} }; dg(); } void main () { auto a = [3, 4, 5]; foo(a); } Error message: main.d(9): Error: variable main.foo.__lambda1.__aggr1174 inout variables can only be declared inside inout functions main.d(9): Error: variable main.foo.__lambda1.e inout variables can only be declared inside inout functions
https://github.com/D-Programming-Language/dmd/pull/2399
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/95830234837da368f19be6ac4ed0ae2538ea2ecd fix issue 9859 - Cannot use inout in delegate https://github.com/D-Programming-Language/dmd/commit/874036c5847a8cd7ea84d3d74d5281a75fea90e2 Merge pull request #2399 from hpohl/9859 fix issue 9859 - Cannot use inout in delegate