Merge remote-tracking branch 'upstream/stable' into merge_stable

This commit is contained in:
Iain Buclaw 2023-08-15 19:18:40 +00:00
commit ecb5606acd

View file

@ -1384,7 +1384,7 @@ if (Ranges.length > 0 &&
// force staticMap type conversion to Rebindable // force staticMap type conversion to Rebindable
static struct ResultRanges static struct ResultRanges
{ {
staticMap!(Rebindable, Ranges) fields; staticMap!(Rebindable, typeof(source)) fields;
} }
auto sourceI(size_t i)() => rebindable(this.source[i]); auto sourceI(size_t i)() => rebindable(this.source[i]);
auto resultRanges = ResultRanges(staticMap!(sourceI, aliasSeqOf!(R.length.iota))).fields; auto resultRanges = ResultRanges(staticMap!(sourceI, aliasSeqOf!(R.length.iota))).fields;
@ -1672,6 +1672,17 @@ pure @safe unittest
assert(range.array == [S(5), S(6)]); assert(range.array == [S(5), S(6)]);
} }
/// https://issues.dlang.org/show_bug.cgi?id=24064
pure @safe nothrow unittest
{
import std.algorithm.comparison : equal;
import std.typecons : Nullable;
immutable Nullable!string foo = "b";
string[] bar = ["a"];
assert(chain(bar, foo).equal(["a", "b"]));
}
pure @safe nothrow @nogc unittest pure @safe nothrow @nogc unittest
{ {
// support non-copyable items // support non-copyable items