mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 12:28:08 +02:00
25 lines
307 B
ObjectPascal
25 lines
307 B
ObjectPascal
{ %FAIL }
|
|
|
|
program tfuncref41;
|
|
|
|
{$mode objfpc}
|
|
{$ModeSwitch functionreferences}
|
|
|
|
type
|
|
TFuncRef = reference to function: LongInt;
|
|
|
|
generic function Test<T>(aArg: array of LongInt): TFuncRef;
|
|
|
|
function TestSub: LongInt;
|
|
begin
|
|
Result := aArg[2];
|
|
end;
|
|
|
|
begin
|
|
Result := @TestSub;
|
|
end;
|
|
|
|
begin
|
|
end.
|
|
|