mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 02:28:14 +02:00
28 lines
346 B
ObjectPascal
28 lines
346 B
ObjectPascal
{ %FAIL }
|
|
|
|
program tanonfunc42;
|
|
|
|
{$mode objfpc}
|
|
{$modeswitch anonymousfunctions}
|
|
{$modeswitch functionreferences}
|
|
|
|
{ test that capturing parent method's Result is rejected }
|
|
|
|
type
|
|
tproc = reference to procedure;
|
|
|
|
function Foo: Integer;
|
|
var P: TProc;
|
|
begin
|
|
Result := 0;
|
|
P := procedure
|
|
begin
|
|
Result := 1
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
Foo;
|
|
end.
|
|
|