diff --git a/dip1000.mak b/dip1000.mak index 075421e68d2..7ec4c9a1a8f 100644 --- a/dip1000.mak +++ b/dip1000.mak @@ -172,7 +172,7 @@ aa[std.net.curl]=-dip1000 # TODO have a look into open https://github.com/dlang/ aa[std.net.isemail]=-dip1000 aa[std.range.interfaces]=-dip1000 -aa[std.range.package]=-dip25 # reference to local variable a / b assigned to non-scope parameter _param_1 / _param_2 calling std.range.chooseAmong!(RefAccessRange, RefAccessRange).chooseAmong +aa[std.range.package]=-dip1000 aa[std.range.primitives]=-dip1000 aa[std.regex.package]=-dip1000 diff --git a/std/range/package.d b/std/range/package.d index b60b1226f07..f360fdb92fd 100644 --- a/std/range/package.d +++ b/std/range/package.d @@ -1718,12 +1718,12 @@ if (Ranges.length >= 2 static struct RefAccessRange { int[] r; - ref front() @property { return r[0]; } - ref back() @property { return r[$ - 1]; } + scope ref front() @property { return r[0]; } + scope ref back() @property { return r[$ - 1]; } void popFront() { r = r[1 .. $]; } void popBack() { r = r[0 .. $ - 1]; } auto empty() @property { return r.empty; } - ref opIndex(size_t i) { return r[i]; } + scope ref opIndex(size_t i) { return r[i]; } auto length() @property { return r.length; } alias opDollar = length; auto save() { return this; } @@ -5059,15 +5059,15 @@ nothrow pure @system unittest static struct NonSliceableRandomAccess { private int[] a; - @property ref front() + @property scope ref front() { return a.front; } - @property ref back() + @property scope ref back() { return a.back; } - ref opIndex(size_t i) + scope ref opIndex(size_t i) { return a[i]; }