Several compilation issues in https://github.com/jacob-carlborg/dstep because of attribute inference + return Most simple example: --- void main () { import std.socket; auto f = new TcpSocket; char[256] buffer; char[] delegate() read = () { size_t num = f.receive(buffer); return buffer[0 .. num]; }; } --- sample.d(8): Error: cannot implicitly convert expression (__lambda1) of type char[] delegate() return @safe to char[] delegate() sample.d(8): Error: cannot implicitly convert expression (__lambda1) of type char[] delegate() return @safe to char[] delegate()
Reduces to: void main() { char[256] buffer; char[] delegate() read = () { return buffer[]; }; }
https://github.com/dlang/dmd/pull/6495
Pull for the stable branch: https://github.com/dlang/dmd/pull/6497
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/74f7a29935fe55a718a7bb92248e3c455bb4e105 fix Issue 17123 - [REG 2.073] Issues with return @safe inference https://github.com/dlang/dmd/commit/dc279ec2003e4f4847fc9ebe1713bb99a2da99d9 Merge pull request #6497 from WalterBright/fix1707-stable fix Issue 17123 - [REG 2.073] Issues with return @safe inference
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/74f7a29935fe55a718a7bb92248e3c455bb4e105 fix Issue 17123 - [REG 2.073] Issues with return @safe inference https://github.com/dlang/dmd/commit/dc279ec2003e4f4847fc9ebe1713bb99a2da99d9 Merge pull request #6497 from WalterBright/fix1707-stable
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7dd10aaf145981ce994e17abece5d90765222625 fix Issue 17123 - [REG 2.073] Issues with return @safe inference
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/74f7a29935fe55a718a7bb92248e3c455bb4e105 fix Issue 17123 - [REG 2.073] Issues with return @safe inference https://github.com/dlang/dmd/commit/dc279ec2003e4f4847fc9ebe1713bb99a2da99d9 Merge pull request #6497 from WalterBright/fix1707-stable https://github.com/dlang/dmd/commit/7dd10aaf145981ce994e17abece5d90765222625 fix Issue 17123 - [REG 2.073] Issues with return @safe inference