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); } ----
@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
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