tfuncref37.pp 288 B

123456789101112131415161718192021222324
  1. { %FAIL }
  2. program tfuncref37;
  3. {$mode objfpc}
  4. {$ModeSwitch functionreferences}
  5. type
  6. TFuncRef = reference to function: LongInt;
  7. function Test(var aArg: LongInt): TFuncRef;
  8. function TestSub: LongInt;
  9. begin
  10. Result := aArg;
  11. end;
  12. begin
  13. Result := @TestSub;
  14. end;
  15. begin
  16. end.