Bug 20682 – [DIP1000] wrong error: scope variable may not be copied into allocated memory

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-17T16:44:37Z
Last change time
2020-03-19T06:59:19Z
Keywords
pull, rejects-valid, safe
Assigned to
No Owner
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2020-03-17T16:44:37Z
Similar to issue 20675. ---- struct D { int pos; char* p; } int f1(return scope ref D d) @safe { return d.pos; } ref int f2(return scope ref D d) @safe { return d.pos; } void test(scope ref D d) @safe { int[] da; da ~= f1(d); da ~= f2(d); } ----
Comment #1 by dlang-bot — 2020-03-17T16:56:22Z
@aG0aep6G created dlang/dmd pull request #10935 "fix issue 20682 - [DIP1000] wrong error: scope variable may not be co…" fixing this issue: - fix issue 20682 - [DIP1000] wrong error: scope variable may not be copied into allocated memory https://github.com/dlang/dmd/pull/10935
Comment #2 by dlang-bot — 2020-03-19T06:59:19Z
dlang/dmd pull request #10935 "fix issue 20682 - [DIP1000] wrong error: scope variable may not be co…" was merged into master: - 84044afae2b3ebc23088dd1d201edba1b044559c by aG0aep6G: fix issue 20682 - [DIP1000] wrong error: scope variable may not be copied into allocated memory https://github.com/dlang/dmd/pull/10935