test for #2109
This commit is contained in:
parent
76a7e8e4cf
commit
581317eb7f
20
TestSuite/lambdas9.pas
Normal file
20
TestSuite/lambdas9.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
var l: array of byte;
|
||||||
|
|
||||||
|
procedure p1<T>(f: ()->T);
|
||||||
|
begin
|
||||||
|
f();
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
p1(()->
|
||||||
|
begin
|
||||||
|
Result := new byte[1];
|
||||||
|
|
||||||
|
loop 1 do
|
||||||
|
begin
|
||||||
|
Result[0] := 1;
|
||||||
|
end;
|
||||||
|
l := Result;
|
||||||
|
end);
|
||||||
|
assert(l[0] = 1);
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue