Debian Codegraph @

gcc/testsuite/gdc.test/compilable/issue23391.d

raw
1 struct MyTuple {
2 string s;
3 }
4
5 inout(string) myfront(inout(string)[] a)
6 {
7 return a[0];
8 }
9
10 MyTuple[] myarray(MyZip r)
11 {
12 MyTuple[] result;
13 foreach (e; r)
14 result ~= e;
15 return result;
16 }
17
18 struct MyZip
19 {
20 bool empty = false;
21 MyTuple front()
22 {
23 return MyTuple([""].myfront);
24 }
25 void popFront()
26 {
27 empty = true;
28 }
29 }
30
31 static foreach(t; MyZip().myarray) {}