← Back to index
|
Original Bugzilla link
Bug 17935 – [scope] auto-generated destructor not scope aware
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-10-25T01:00:20Z
Last change time
2017-12-18T22:56:40Z
Keywords
safe
Assigned to
Walter Bright
Creator
Martin Nowak
Comments
Comment #0
by code — 2017-10-25T01:00:20Z
cat > bug.d << CODE struct ByChunk(IO) { @safe: ~this() scope {} ubyte[] buf; IO io; } struct IO { ~this() @safe scope {} } /// @safe @nogc unittest { ubyte[256] buf; auto chunks = ByChunk!IO(buf[], IO()); chunks.__xdtor(); // auto-generated inclusive (fields and struct) dtor } CODE dmd -c -dip1000 bug.d ---- bug.d(21): Error: scope variable `chunks` assigned to non-scope parameter `this` calling bug.ByChunk!(IO).ByChunk.~this bug.d(22): Error: scope variable `chunks` assigned to non-scope parameter `this` calling bug.ByChunk!(IO).ByChunk.~this ---- Guess we should at best always attempt to infer scope for any generate method.
Comment #1
by bugzilla — 2017-11-04T02:09:57Z
https://github.com/dlang/dmd/pull/7283
Comment #2
by github-bugzilla — 2017-11-09T20:08:13Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/c9ff5810a2f449f19a39172461d511c895dcb519
fix Issue 17935 - [scope] auto-generated destructor not scope aware
https://github.com/dlang/dmd/commit/0bb4ad1668fa7ea6539c2bf2c7035309afabbdd4
Merge pull request #7283 from WalterBright/fix17935 fix Issue 17935 - [scope] auto-generated destructor not scope aware merged-on-behalf-of: Mathias Lang <
[email protected]
>
Comment #3
by github-bugzilla — 2017-12-18T22:56:40Z
Commits pushed to stable at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/c9ff5810a2f449f19a39172461d511c895dcb519
fix Issue 17935 - [scope] auto-generated destructor not scope aware
https://github.com/dlang/dmd/commit/0bb4ad1668fa7ea6539c2bf2c7035309afabbdd4
Merge pull request #7283 from WalterBright/fix17935