import std.stdio; version=Broken; void main() { version(Broken) { auto tbl = [ (string x) { writeln(x); }, (string x) { x ~= 'a'; }, ]; } else { auto tbl = [ (string x) { x ~= 'a'; }, (string x) { writeln(x); }, ]; } } This code used to compile in dmd 2.058. Commenting out "version=Broken" fixes the problem. It seems that type inference isn't being done correctly for the delegates in the array, depending on what order they appear in.
https://github.com/D-Programming-Language/dmd/pull/1374
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3c81eff3ea8da324698ab05bf6fd5e105762414e fix Issue 9153 - Type inference for array of delegates should not break based on order https://github.com/D-Programming-Language/dmd/commit/c9373834865ffe6a11e3bfae4c3507ee151cd0c0 Merge pull request #1374 from 9rnsr/fix_funclit Issue 9153 - Type inference for array of delegates should not break based on order