tfuncref19.pp 255 B

12345678910111213141516
  1. { %FAIL }
  2. { it's not allowed to call IUnknown methods on a function reference directly }
  3. program tfuncref19;
  4. {$mode objfpc}
  5. {$modeswitch functionreferences}
  6. type
  7. TProc = reference to procedure(aArg: LongInt);
  8. var
  9. p: TProc;
  10. begin
  11. p._AddRef;
  12. end.