Bug 17123 – [REG 2.073] Issues with return @safe inference

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-01-26T13:41:00Z
Last change time
2017-02-24T20:34:28Z
Keywords
safe
Assigned to
nobody
Creator
public

Comments

Comment #0 by public — 2017-01-26T13:41:22Z
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()
Comment #1 by bugzilla — 2017-01-27T19:06:39Z
Reduces to: void main() { char[256] buffer; char[] delegate() read = () { return buffer[]; }; }
Comment #2 by bugzilla — 2017-01-28T05:10:07Z
Comment #3 by bugzilla — 2017-01-29T10:35:06Z
Pull for the stable branch: https://github.com/dlang/dmd/pull/6497
Comment #4 by github-bugzilla — 2017-01-29T14:14:28Z
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
Comment #5 by github-bugzilla — 2017-02-01T07:25:42Z
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
Comment #6 by github-bugzilla — 2017-02-12T15:13:39Z
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
Comment #7 by github-bugzilla — 2017-02-24T20:34:28Z
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