mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-26 16:33:41 +02:00
27 lines
422 B
ObjectPascal
27 lines
422 B
ObjectPascal
unit uanonfunc55;
|
|
|
|
{$mode objfpc}{$H+}
|
|
{$modeswitch advancedrecords}
|
|
{$modeswitch functionreferences}
|
|
{$modeswitch anonymousfunctions}
|
|
|
|
interface
|
|
|
|
type
|
|
generic TFunc<T> = reference to function: T;
|
|
|
|
generic function Foo<T>: specialize TFunc<T>;
|
|
|
|
implementation
|
|
|
|
generic function Foo<T>: specialize TFunc<T>;
|
|
begin
|
|
Result := function: T
|
|
begin
|
|
Result := Default(T);
|
|
end;
|
|
end;
|
|
|
|
end.
|
|
|