pascalabcnet/TestSuite/extensionmethods22.pas
Бондарев Иван 07d35c674a bug fix #485
2017-09-11 21:06:16 +02:00

13 lines
234 B
ObjectPascal

type BallInfo = class
x: integer;
end;
begin
var a : array of BallInfo;
a := new BallInfo[2](new BallInfo, new BallInfo);
var s := 0;
a[0].x := 1;
a[1].x := 2;
a.ForEach(x->begin s += x.x end);
assert(s = 3);
end.