Compile with -preview=dip1000: --- struct D { int pos; char* p; } void test(scope ref D d) @safe { D[] da; // works const pos = d.pos; da ~= D(pos, null); // wrongly fails with // Error: scope variable d may not be copied into allocate memory da ~= D(d.pos, null); } ---
@aG0aep6G created dlang/dmd pull request #10929 "fix issue 20675 - dip1000 improper error about copying scope paramete…" fixing this issue: - fix issue 20675 - dip1000 improper error about copying scope parameter into allocated memory https://github.com/dlang/dmd/pull/10929
@WalterBright created dlang/dmd pull request #10931 "fix Issue 20675 - dip1000 improper error about copying scope paramete…" fixing this issue: - fix Issue 20675 - dip1000 improper error about copying scope parameter into allocated memory https://github.com/dlang/dmd/pull/10931
dlang/dmd pull request #10929 "fix issue 20675 - dip1000 improper error about copying scope paramete…" was merged into master: - 4b7eccf3430b2444b2158f8ba7e2954f3919d29e by aG0aep6G: fix issue 20675 - dip1000 improper error about copying scope parameter into allocated memory - b93c70082931b2c39b39819728a0f5f7afb16a83 by aG0aep6G: move test for issue 20675 to test/compilable/scope.d https://github.com/dlang/dmd/pull/10929