pascalabcnet/TestSuite/lambda_constructors.pas
Ivan Bondarev 9bd8efce75 #2196
2021-01-06 19:23:07 +01:00

30 lines
372 B
ObjectPascal

var sss: string;
type
t1 = class
constructor;
procedure p0 := exit;
end;
t2 = class
constructor(f: ()->()) := f();
end;
constructor t1.Create;
begin
foreach var i in Arr(0) do
begin
var s := 'tt';
new t2(()->
begin
var s2 := s;
sss := s;
end);
end;
end;
begin
t1.Create.p0;
assert(sss = 'tt');
end.