It's possible create something like this without errors? void main()@nogc{ //Error: function `app.main` is `@nogc` // yet allocates closures with the GC import std.experimental.all; const int j = 2; int i = 0; const int[3] tmp = [1, 2, 3]; tmp[] .filter!((x)scope => x == j) ///main.__lambda1 closes over variable j .each!((x)scope => i = x); }