From cfcb1e727a777b26f2b43e297e7a846fdaa58f0d Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 29 May 2022 21:43:08 +0200 Subject: [PATCH] Fix foldr scope --- source/tanya/algorithm/iteration.d | 2 +- source/tanya/algorithm/mutation.d | 4 +--- tests/tanya/tests/format.d | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/tanya/algorithm/iteration.d b/source/tanya/algorithm/iteration.d index aae83f1..8074fc1 100644 --- a/source/tanya/algorithm/iteration.d +++ b/source/tanya/algorithm/iteration.d @@ -226,7 +226,7 @@ if (F.length == 1) * * Returns: Accumulated value. */ - auto foldr(R, T)(R range, auto ref T init) + auto foldr(R, T)(scope R range, scope return auto ref T init) if (isBidirectionalRange!R) { if (range.empty) diff --git a/source/tanya/algorithm/mutation.d b/source/tanya/algorithm/mutation.d index 88f7da3..6a6edd6 100644 --- a/source/tanya/algorithm/mutation.d +++ b/source/tanya/algorithm/mutation.d @@ -177,9 +177,7 @@ if (isInputRange!Range && hasLvalueElements!Range) import tanya.memory.op : copy, fill; alias T = ElementType!Range; - static if (__VERSION__ >= 2083 - && isDynamicArray!Range - && __traits(isZeroInit, T)) + static if (isDynamicArray!Range && __traits(isZeroInit, T)) { fill!0(range); } diff --git a/tests/tanya/tests/format.d b/tests/tanya/tests/format.d index f080a67..84b84d5 100644 --- a/tests/tanya/tests/format.d +++ b/tests/tanya/tests/format.d @@ -258,7 +258,7 @@ unittest } // Typeid -nothrow pure @safe unittest +nothrow @safe unittest { assert(format!"{}"(typeid(int[])) == "int[]");