pascalabcnet/TestSuite/foreach6.pas

12 lines
236 B
ObjectPascal
Raw Normal View History

2018-08-08 19:03:44 +03:00
function test<T>(a: T): sequence of T;
begin
var lst: List<List<T>> := new List<List<T>>;
lst.Add(new List<T>(Arr(a, a)));
foreach var x in lst do
begin
yield x[0];
end;
end;
begin
assert(test(2).ToArray[0] = 2);
end.