summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2022-05-29 21:43:08 +0200
committerEugen Wissner <belka@caraus.de>2022-05-30 05:43:08 +0200
commitcfcb1e727a777b26f2b43e297e7a846fdaa58f0d (patch)
tree2d33a48067d84598c796fe4ab8ae1eeceb55272b
parentc7bfbe06570b986e10c27a483dad83908feb892f (diff)
downloadtanya-cfcb1e727a777b26f2b43e297e7a846fdaa58f0d.tar.gz
Fix foldr scope
-rw-r--r--source/tanya/algorithm/iteration.d2
-rw-r--r--source/tanya/algorithm/mutation.d4
-rw-r--r--tests/tanya/tests/format.d2
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[]");