Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make "myProc = procedure of object" deprecated?

Tags:

delphi

I m under Delphi Tokyo release 2 and I have this declaration:

type 
  FIRMessagingConnectCompletion = procedure of object;

That I would flag as deprecated. I try like this:

type
  FIRMessagingConnectCompletion = procedure of object deprecated 'Please listen for the FIRMessagingConnectionStateChangedNotification NSNotification instead.';

But didn't work with error "E1030 Invalid compiler directive: 'DEPRECATED'". What did I miss?

like image 950
zeus Avatar asked Apr 07 '18 12:04

zeus


1 Answers

It seems that this is not allowed by the compiler. But there is a workaround:

type
    TProc = procedure of object;
    TProc1 = TProc deprecated 'test';

Update:
As pointed in comennts will be better this variant

type
    __InternalFakeProcType__ = procedure of object;
    TProc = __InternalFakeProcType__ deprecated 'test';
like image 83
Vasek Avatar answered Oct 12 '22 13:10

Vasek