test for #2686
This commit is contained in:
parent
d163ae2f23
commit
fb5ecd3780
19
TestSuite/lambdas19.pas
Normal file
19
TestSuite/lambdas19.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
var i: integer;
|
||||
|
||||
procedure p1<T>(p: procedure);
|
||||
begin
|
||||
var pp := procedure->
|
||||
begin
|
||||
// Обязательно захватить p
|
||||
p := p;
|
||||
Inc(i);
|
||||
end;
|
||||
pp;
|
||||
end;
|
||||
|
||||
begin
|
||||
p1&<integer>(()->begin
|
||||
|
||||
end);
|
||||
assert(i = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue