This code is (correctly) accepted by DMD 2.067: void main(){ auto foo1()pure immutable{ return 0; } auto foo2()pure const{ return 0; } } But this is not: void main(){ auto dg1=()pure immutable{ return 0; }; auto dg2=()pure const{ return 0; }; } Both should compile. (There should be no difference in how qualifiers are handled for named and anonymous nested functions.)
https://github.com/D-Programming-Language/dmd/pull/4800
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6b42d4df211895b225866f52bdef4e156949c6ce fix Issue 14745 - Qualifiers rejected for delegate literals https://github.com/D-Programming-Language/dmd/commit/cd96e7ad1af71c601484d474be9f03dc2a3d2fd5 Merge pull request #4800 from 9rnsr/fix14745 Issue 14745 - Qualifiers rejected for delegate literals
I've forgotten to update grammar. https://github.com/D-Programming-Language/dlang.org/pull/1086
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/82b23acdd383b4d5a2249448c8fe565ecfd5fa4e fix Issue 14745 - Qualifiers rejected for delegate literals https://github.com/D-Programming-Language/dlang.org/commit/d8330a1739cb4327e96a66bbc6db1be7c96096a7 Merge pull request #1086 from 9rnsr/fix14745 Issue 14745 - Qualifiers rejected for delegate literals
Commits pushed to stable at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/82b23acdd383b4d5a2249448c8fe565ecfd5fa4e fix Issue 14745 - Qualifiers rejected for delegate literals https://github.com/D-Programming-Language/dlang.org/commit/d8330a1739cb4327e96a66bbc6db1be7c96096a7 Merge pull request #1086 from 9rnsr/fix14745