dmd/compiler/test/compilable/issue23391.d

31 lines
414 B
D

struct MyTuple {
string s;
}
inout(string) myfront(inout(string)[] a)
{
return a[0];
}
MyTuple[] myarray(MyZip r)
{
MyTuple[] result;
foreach (e; r)
result ~= e;
return result;
}
struct MyZip
{
bool empty = false;
MyTuple front()
{
return MyTuple([""].myfront);
}
void popFront()
{
empty = true;
}
}
static foreach(t; MyZip().myarray) {}