Bug 17029 – [Reg 2.072] scope variable may not be returned

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-12-25T03:43:00Z
Last change time
2017-01-16T23:25:58Z
Keywords
safe
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2016-12-25T03:43:22Z
cat > bug.d << CODE struct Del { void delegate() dg; } Del del(scope void delegate() dg) { return Del(dg); } CODE dmd -c bug ---- bug.d(8): Error: scope variable dg may not be returned ---- This broke at least https://github.com/DlangScience/dstats. Before DIP1000 scope had 2 major use cases, prevent the compiler from allocating closures on the GC heap and scope classes. We must be careful to not just break existing code.
Comment #1 by bugzilla — 2016-12-25T13:56:33Z
Comment #2 by github-bugzilla — 2016-12-25T19:24:42Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/063bcfca0b30f31a18ebf2b1fae2873805b7d445 fix Issue 17029 - [Reg 2.072] scope variable may not be returned https://github.com/dlang/dmd/commit/83d7bc0d500edf95589e723f2ecc3a4fca51c54a Merge pull request #6363 from WalterBright/fix17029 fix Issue 17029 - [Reg 2.072] scope variable may not be returned
Comment #3 by github-bugzilla — 2016-12-27T02:35:04Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/063bcfca0b30f31a18ebf2b1fae2873805b7d445 fix Issue 17029 - [Reg 2.072] scope variable may not be returned https://github.com/dlang/dmd/commit/83d7bc0d500edf95589e723f2ecc3a4fca51c54a Merge pull request #6363 from WalterBright/fix17029
Comment #4 by github-bugzilla — 2016-12-27T03:57:57Z
Commit pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c8d9e33ea2f7337b40866f15f37fbec058262eed Merge pull request #6363 from WalterBright/fix17029 fix Issue 17029 - [Reg 2.072] scope variable may not be returned # Conflicts: # src/escape.d
Comment #5 by github-bugzilla — 2016-12-27T14:41:44Z
Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/063bcfca0b30f31a18ebf2b1fae2873805b7d445 fix Issue 17029 - [Reg 2.072] scope variable may not be returned https://github.com/dlang/dmd/commit/83d7bc0d500edf95589e723f2ecc3a4fca51c54a Merge pull request #6363 from WalterBright/fix17029
Comment #6 by github-bugzilla — 2016-12-31T18:15:37Z
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c8d9e33ea2f7337b40866f15f37fbec058262eed Merge pull request #6363 from WalterBright/fix17029
Comment #7 by github-bugzilla — 2017-01-16T23:25:58Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/063bcfca0b30f31a18ebf2b1fae2873805b7d445 fix Issue 17029 - [Reg 2.072] scope variable may not be returned https://github.com/dlang/dmd/commit/83d7bc0d500edf95589e723f2ecc3a4fca51c54a Merge pull request #6363 from WalterBright/fix17029 https://github.com/dlang/dmd/commit/c8d9e33ea2f7337b40866f15f37fbec058262eed Merge pull request #6363 from WalterBright/fix17029