pascalabcnet/TestSuite/foreach9.pas
Ivan Bondarev 46a4f5d766 #2480
2021-05-16 11:52:32 +02:00

24 lines
349 B
ObjectPascal

var i: integer;
type
t1 = record
private function InitA: integer;
begin
Inc(i);
end;
public a := InitA;
public b: integer;
public constructor(b: integer) := self.b := b;
end;
begin
var l := new List<t1>;
l += new t1(2);
l += new t1(3);
foreach var o in l do
;
assert(i = 2);
end.