mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 15:49:04 +02:00
34 lines
449 B
ObjectPascal
34 lines
449 B
ObjectPascal
{$mode objfpc}
|
|
{$modeswitch nestedprocvars}
|
|
|
|
type
|
|
tnestedfunc = function (i: longint): longint is nested;
|
|
|
|
function test: longint;
|
|
var
|
|
i: longint;
|
|
|
|
function func3(aa: longint): longint;
|
|
begin
|
|
result:=i+aa;
|
|
end;
|
|
|
|
function func(aa: integer): integer;
|
|
var
|
|
nf: tnestedfunc;
|
|
begin
|
|
nf:=@func3;
|
|
result:=nf(aa);
|
|
end;
|
|
|
|
begin
|
|
i:=100;
|
|
result:=func(10);
|
|
end;
|
|
|
|
begin
|
|
if test <> 110 then
|
|
halt(1);
|
|
writeln('OK');
|
|
end.
|